Next
Update
Prev
Default

You can fill color in the shape drawn at each data point in the line chart using the JavaScript function. To fill custom color in the line chart, you must set a JavaScript function name to the value of fillJsFunction attribute in the <Line2DSeries> element tag.

This sample line chart is to show how to define a JavaScript function to fill custom color in the circular shape drawn at each data point based on data values.

...
<Line2DChart ... >
'''
  <Line2DSeries ... itemRenderer="CircleItemRenderer" fillJsFunction="fillJsFunc" >
    ...
  </Line2DSeries>
...
</Line2DChart>
...
					
function fillJsFunc(seriesId, index, data, values)
{
  if (values[1] > 2000)
    return "0xFF3366";
  else if (values[1] > 1000)
    return "0xFFFF33";
  else
    return "0xFF9999";	
}

© 2017 KoolChart. All rights reserved.