Is it possible to change style for a specific SChartDataPoint in SChartColumnSeries?


#1

Hi All,

I found how to change the style for the complete serie but is it possible to change the style for a simple data point?

The purpose of this topic is that I need to highlight a specific bar when it’s clicked…

Thanks in advance,

nuklehon


#2

Hey,

Right now, we don’t support point-selection for bar or column series - so it isn’t as easy to produce that effect as with our other series.

The only way to style a single bar separately from the rest of it’s series at the moment is to draw it separately in a different series. You could use the delegate callbacks to identify the point that has been selected and update your datasource to pass that datapoint in a ‘selected’ series, styled as you wish. Then call reloadData on your chart to update. To prevent this other series from appearing alongside the first, simply set both series’ stackIndex to the same value. If you have panning/zooming enabled, you may also wish to preserve the ranges of your axes across the reload and redraw, by inspecting them before and re-setting them afterwards.

Best,

Simon


#3

Thanks Simon!

I’ll implement this trick in my project.

Regards,