shinobi charts - adding symbols and a legend

677 Views Asked by At

I have been using shinobi charts in iOS and I have a line graph in my app - I would now like to add some symbols to the data points and a legend to explain what the symbols mean - If someone could point me to some sample code that would be very helpful.

Thanks.

1

There are 1 best solutions below

1
On BEST ANSWER

There is a datasource method which you can use to provide a UIImage for each of the data points:

- (UIImage *)sChartTextureForPoint:(ShinobiChart *)chart
                  dataPointAtIndex:(NSInteger)dataIndex
                  forSeriesAtIndex:(NSInteger)seriesIndex

If you implement this then you can provide the symbols as you wish.

The legend is a little more difficult. A legend is usually designed to allow identification of distinct series, however in this instance you would like to identify specific points. This isn't functionality currently supported by Shinobi, and although it would be possible to implement it using the SChartLegend class, I think you would be better off creating your own subclass of UIView as a legend.