This content has been marked as final. Show 5 replies
Set the series' filterData property to false.
However, there's a bug in the framework that means if you have filterData set to false and, for example, set the minimum or maximum of an axis the series will no longer provide any hitData (i.e. will appear to be non-interactive). There's a workaround though so all is not lost. And if you don't need hitData from the series then it's no problem at all.
Thanks a lot.
I do need hitData together with filterData for events processing. Can you please tell the work around?
By the way, using filterData = false results in slightly slower rendering because it is doing the computations required for all the points rather than just those in the axes ranges. An halfway-house solution might be to use filterData = false combined with manual filtering of the data provider to ensure you are just getting it to render a smaller portion of the data.
Anyway, the workaround. You'll have to have a poke around in the LineSeries source code to fully understand what I'm saying here. You need to extend the LineSeries class and extend the findDataPoints function. In the LineSeries' findDataPoints function the if (!isNaN(v.yFilter) && !isNaN(v.xFilter)) condition will fail because when filterData = false and the filterCache function of the series is called (this happens when the min or max of an axis is set because the mapping changes) the .yFilter and xFilter properties will be NaN. That makes sense in it's own way, but the upshot of that is that the minItem variable is never set and, therefore, an empty array will always be returned.
So the fix is to copy the code from the LineSeries source code and in your overriding function change the if (!isNaN(v.yFilter) && !isNaN(v.xFilter)) condition to if (!isNaN(v.yNumber) && !isNaN(v.xNumber)). Before you do that though, check that your y/xFilter and y/xNumber properties do represent the same value. So yes, this is a nasty little hack but I haven't found any other way to solve the problem.
Thank you very much. I could get the dataTips and hitData now by using the extended class of LineSeries.
However I could not understand your comment "Before you do that though, check that your y/xFilter and y/xNumber properties do represent the same value. ".
Ignore it, I was confusing this workaround with some other work (something surprisingly similar) I have been doing.
Glad it's sorted your problem too.