Open NisSAM opened 11 years ago
Could you create a fiddle as an example? http://jsfiddle.net/cesutherland/ZFBj5/
On Tue, Jul 2, 2013 at 7:52 AM, NisSAM notifications@github.com wrote:
I have created my own chart type that has its own hit function. But when it doesn't find closest point hit.closest function fires while I need to stop search here.
I need a way (some option) to prevent hit.closest function run even if the hit in custom type found nothing.
— Reply to this email directly or view it on GitHubhttps://github.com/HumbleSoftware/Flotr2/issues/231 .
Carl, it is very difficult because I use a very unusual type plugin written by myself. But the problem is the if (options.mouse.trackY && !options.mouse.trackAll && this.hit.executeOnType(this.series, 'hit', [mouse, n]) && !_.isUndefined(n.seriesIndex)) { series = this.series[n.seriesIndex]; n.series = series; n.mouse = series.mouse; n.xaxis = series.xaxis; n.yaxis = series.yaxis; } else {
closest = this.hit.closest(mouse);
If we didn't fill n.seriesIndex hit plugin will run closest = this.hit.closest(mouse); line. I need a way to prevent it. Of course I can just comment this line but I will need to do this with every flort2 update. That's all.
OK I think I understand the issue. It is using the default hit method if it is not finding a hit within your chart type. Is that correct?
On Tue, Jul 2, 2013 at 8:34 AM, NisSAM notifications@github.com wrote:
Carl, it is very difficult because I use a very unusual type plugin written by myself. But the problem is the if (options.mouse.trackY && !options.mouse.trackAll && this.hit.executeOnType(this.series, 'hit', [mouse, n]) && !_.isUndefined(n.seriesIndex)) { series = this.series[n.seriesIndex]; n.series = series; n.mouse = series.mouse; n.xaxis = series.xaxis; n.yaxis = series.yaxis; } else {
closest = this.hit.closest(mouse);
If we didn't fill n.seriesIndex hit plugin will run closest = this.hit.closest(mouse); line. I need a way to prevent it. Of course I can just comment this line but I will need to do this with every flort2 update. That's all.
— Reply to this email directly or view it on GitHubhttps://github.com/HumbleSoftware/Flotr2/issues/231#issuecomment-20343005 .
Yes, you are right.
I think this is enough to solve it: in the if conditions, check that there is a hit method on the configured chart types instead of checking for an actual hit.
What kind of graph have you created? I'd still be interested to see, even if it's a screen shot.
On Tue, Jul 2, 2013 at 8:38 AM, NisSAM notifications@github.com wrote:
Yes, you are right.
— Reply to this email directly or view it on GitHubhttps://github.com/HumbleSoftware/Flotr2/issues/231#issuecomment-20343154 .
For me your fix will be OK but I am not sure about others.
I'll send the archive with the graph later to you e-mail.
I've found a dirty temporary solution
Flotr.plugins.hit.closest = function (mouse) {return false};
I have created my own chart type that has its own hit function. But when it doesn't find closest point hit.closest function fires while I need to stop search here.
I need a way (some option) to prevent hit.closest function run even if the hit in custom type found nothing.