JS API example for barchart.