add javascript function for creating histograms
update histogram