Next
Update
Prev
Default

You can fill color in bars using the JavaScript function. To fill custom color in the bar chart, you must set a JavaScript function name to the value of fillJsFunction attribute in the <Bar2DSeries> or <Bar3DSeries> element tags.

This sample bar chart is to show how to define a JavaScript function to fill custom color in bars based on data values.

...
<Bar3DChart ... >
'''
  <Bar3DSeries ... fillJsFunction="fillJsFunc" >
    ...
  </Bar3DSeries>
...
</Bar3DChart>
...

function fillJsFunc(seriesId, index, data, values)
{
  if (values[1] > 2000)
    return "0x43a9ff";
  else if (values[1] > 1000)
    return "0xbde030";
  else
    return "0xfa880d";	
}

© 2017 KoolChart. All rights reserved.