I have built a candlestick chart by IGFinancialPriceSeries:
How can I get the candlestick's data by viewForTooltipWithItemlist ?
A futher question:
If the chartview's setting likes these:
infraChart.zoomDisplayType = IGChartZoomHorizontal;infraChart.maximumZoomScale = 3.0f;infraChart.minimumZoomScale = 0.5f;
After I scale or drag it, can I use viewForTooltipWithItemlist method to get the data of candlestick in series?
Thanks.
That works.
Hi,
If you look at the itemList parameter, it's a dictionary, where the value is the data point you pressed on and the key is the series.If you only have one series in the chart, you can access the data point by simply using IGOHLCPoint *dataPoint = (IGOHLCPoint*)[itemList valueForKey:@"yourSeriesKey"];If you have multiple series in the chart, it's best to use the delegate method with an added CGPoint parameter, like so:
-(UIView *)chartView:(IGChartView *)chartView viewForTooltipWithItemlist:(NSDictionary *)itemlist atPoint:(CGPoint)point{ IGSeries *s = [chartView findSeriesAtPoint:point]; IGOHLCPoint *dataPoint = (IGOHLCPoint*)[itemlist valueForKey:s.key];
//rest of implementation}
The code will work equally well after zooming/panning.