Panning / Crosshair bug in 2.9.0.6 Charts?


#1

Hello,

I’ve been trying to upgrade to Shinobi Charts 2.9.0.6 from 2.7.3, and have encountered a conflict between using the tooltip crosshair and panning.

If I enable panning, and use the default tooltip, everything is ok. If I set a custom tool tip (which is what I really want) or even the SChartSeriesCrosshair, panning ceases to work.

I was able to reproduce this in the included “Getting Started” objC example.

  1. Add “lineSeries.crosshairEnabled = YES;” in SeriesAtIndex.
  2. Add “chart.crosshair = [[SChartSeriesCrosshair alloc] init];” in ViewDidLoad.

If I only do “1”, it works fine, but when I add “2”, panning ceases to work.

Am I missing something? Is this a bug?

Thank you.


#2

Hello cbolton,

Thanks for getting in touch!

I can confirm there is an issue with our SChartSeriesCrosshair.

I have implemented a fix that will be included in the next alpha release.

There is a temporary fix you can add to your project to fix the SChartSeriesCrosshair which is to add the CustomSeriesCrosshair I have provided below:

@interface CustomSeriesCrosshair : SChartSeriesCrosshair

@end

@implementation CustomSeriesCrosshair

-(BOOL)isHidden {
    return self.superview == nil;
}

@end

If you are seeing the same issue with your implementation of a custom crosshair, I’d check your implementation of the “isHidden” method is correct.

Let me know if you have any questions.

Kind regards,
Andrew Polkinghorn.


#3

Thank you Andrew.

I’ll wait until the next release since I’m waiting for a fix of the gradient bug anyway.


#4

Hi @cbolton

As with baseline issue, this issue should now be resolved in the 2.9.1-ALPHA build available in the portal.

Would you mind giving it a try and letting me know if you continue to have trouble?

Many thanks,

Sam


#5

The Alpha release partially fixed the problem. It did fix it in the simple sample application. However, in my real app, if I load up a new chart and attempt to do a pan first thing, it still doesn’t work. But if do a long or short tap on the chart, panning will work correctly AFTER that. Also, I noticed I’m getting callbacks to the delegate method “crosshairMovedToXValue” when it should be panning instead (no tooltip is displayed), which I wouldn’t expect.

Thanks again for pushing the Alpha release out quickly.


#6

I was able to reproduce the problem in the GettingStarted example again. Its a little contrived (I have real custom classes in my code that do useful things), but hopefully will demonstrate the problem adequately.

  1. Add “lineSeries.crosshairEnabled = YES;” in SeriesAtIndex.
  2. Add in ViewDidLoad:
    “SChartCrosshair *fakecustomCrossHair = [[SChartCrosshair alloc] initWithChart: chart];”
    “chart.crosshair = fakecustomCrossHair;”

It does look a little odd to me using initWithChart and then assigning it manually to the chart, but if I don’t do the explicit assignment the chart will not use my custom tooltips in my app.


#7

Hi cbolton,

Thanks for bringing this to our attention!

The previous fix was for our SChartSeriesCrosshair and the same issue was inside our SChartCrosshair.

I can confirm that we have fixed this issue inside our SChartCrosshair class and it should be included in our next release.

I’d strongly recommend moving away from our SChartCrosshair class if you are making your own custom crosshair & create a new class that implements the SChartCrosshair protocol instead.

I’ll update this forum post when a version containing this SChartCrosshair fix has been released.

Let me know if you have any questions.

Kind regards,
Andrew Polkinghorn.


#8

Thank you Andrew. I will plan on switching to the SChartCrossHair protocol sometime soon.


#9

Hi cbolton,

Our latest release (2.9.1) includes the fix for our SChartCrosshair class.

It can be downloaded from our customer portal.

Let us know if you have any questions.

Kind regards,
Andrew Polkinghorn.


#10

Worked great. Thank you!