How detect selection of bar in Bar chart?


#1

Thanks for a wonderful libaray.

I am using bar chart in my app. Now I have to show next respective view of selected bar. So for that I have to detct details of selected bar.

So please help me for this.

Thnaks


#2

Bar selection is equivalent to data point selection, and as such there are delegate methods which you can implement to be notified of selection events.

You need to choose the selection mode on the series as series or point (sounds like you want point selection):

barSeries.selectionMode = SChartSelectionPoint;

And then implement the following delegate method:

- (void)sChart:(ShinobiChart *)chart toggledSelectionForPoint:(SChartDataPoint *)dataPoint inSeries:(SChartSeries *)series atPixelCoordinate:(CGPoint)pixelPoint

That method will be called as users select and deselect points.

_sam


#3

sam

Bar selection is equivalent to data point selection, and as such there are delegate methods which you can implement to be notified of selection events.

You need to choose the selection mode on the series as series or point (sounds like you want point selection):

barSeries.selectionMode = SChartSelectionPoint;

And then implement the following delegate method:

- (void)sChart:(ShinobiChart *)chart toggledSelectionForPoint:(SChartDataPoint *)dataPoint inSeries:(SChartSeries *)series atPixelCoordinate:(CGPoint)pixelPoint

That method will be called as users select and deselect points.

_sam

Thank you very much .

It is working awsome.