Crosshair causing crash - 'CALayerInvalidGeometry', reason: 'CALayer position contains NaN: [559 nan]'


#1

Hi,

I am getting crash when using Crosshair enable. I have tried a lot to find out the solution but failed. Please see the below I am providing the github link for the sample app where I am getting the issue. Please find and help me out.

The Issue is: The chart is creating fine. But If I use the below lines for crosshair enable, mainly the second line below then I am getting crash. 

lineSeries.style.pointStyle.showPoints = YES;

lineSeries.crosshairEnabled = YES;

lineSeries.selectionMode = SChartSelectionPoint;

See the github link below.

https://github.com/bankim/shinobi-chart.git

Regards,

Bankim.


#2

Hi mrbankim,

Thanks for getting in touch!

After some investigation I found this to be an issue with our crosshair’s interpolation code that positions the crosshair between two datapoints.

A work around solution to prevent this crash would be to turn off point interpolation on your crosshair by using the following code:

chart.crosshair.interpolatePoints = NO;

I have added this issue to our backlog and a member of our team will update this forum post when the fix for this issue has been released.

Let me know if you have any questions.

Kind regards,
Andrew Polkinghorn


#3

Thanks, It works.


#4

Thanks, It works.


#5

Thanks, It works.


#6

Hi,

For anyone else seeing this issue, we now have a fix in version 2.8.0 of ShinobiCharts, meaning that the above workaround should not be necessary.  smiley lol