I’m running into some issues while trying to show annotations on my graph whose x axis is a date time. The X value is always way outside of the bounds.
In my toggledSelectionForPoint delegate method I try to map the data point X value to its pixel value for the annotation, but the output is always wrong.
double xPoint = [chart.xAxis pixelValueForDataValue:dataPoint.xValue]; double yPoint = [chart.yAxis pixelValueForDataValue:dataPoint.yValue]; NSLog(@"xValue - %@", dataPoint.xValue); NSLog(@"xPoint = %f",xPoint); NSLog(@"yPoint = %f",yPoint);
The value outputted is as follows:
2014-07-17 10:02:30.803 ChartTest[5882:60b] xValue - 2810275200 2014-07-17 10:02:30.804 ChartTest[5882:60b] xPoint = 1159474.000000 2014-07-17 10:02:30.804 ChartTest[5882:60b] yPoint = 40.996597