0

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.

ianM
  • 393
  • 1
  • 3
  • 16

1 Answers1

2

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.

sammyd
  • 883
  • 5
  • 6
  • Thank you, sir! I will check this out. (If anyone else feels like showing me some sample code I'd appreciate that too.) – ianM Jan 13 '14 at 20:51