I have a use case for a chart, that is a heatmap, which may also contain multiple series drawn on top, with multiple internal axis as well.
I can’t transform the data I receive, because that would be too slow, and it needs to maintain a speedy feeling, even when appending more data.
For this reason, when building the chart, I just flip the axis. The bottom axis is the Y axis, and the left axis it the X axis.
The multiple series that can be added (XyDataSeries), provide one extra axis each, and use one of the main axis.
We can think of them as horizontal or vertical series, depending if they use the main X axis, or the main Y axis.
When hovering over the chart, I want to show a tooltip, that shows for each series, their own axis value.
The issue — The normal CursorModifier, can’t correctly present a tooltip, for this case of mixed horizontal/vertical series. I’m not sure if there are configurations I’m missing, or if it is an actual uncovered edge case, hoping to get an answer on this.
To show what the issue is, and how I’m currently fixing it, please have a look at the codepen I made -> https://codepen.io/jrfv/full/zYMjEzP
Any tips on this, is it something scichart will fix eventually?
- João Velasques asked 10 months ago
-
Hi Joao, awesome codepen. I think we fixed an issue in v3.2 -beta related to cursors and flipped heatmaps, but we haven’t tested this case. I’ll ask the team for their input and get back to you soon.
- You must login to post comments
Sorry for the delayed answer.
I removed dataIsSortedInX from the codepen, and the issue still stands.
We correctly identify the green values, but not the blue values.
So in the codepen,
– if you move the mouse exclusively in horizontal direction, you should see only the tooltip for the blue values and the heatmap update
– if you move the mouse exclusively in the vertical direction, you should see the tooltip for the green values and the heatmap update
Only looking at “Flipped Axis – normal CursorModifier” vs “Flipped Axis – CustomCursorModifier”
Not sure if relevant, but I found a hitTestXSlice( https://www.scichart.com/documentation/js/current/typedoc/classes/lineserieshittestprovider.html#hittestxslice) but not a hitTestYSlice, which makes sense in my mind to be what supports these flipped axis scenarios (though I could be blatantly wrong ).
This custom cursor modifier I made up is working for my use case! Just wanted to confirm if there’s a better way to achieve the same result.
Thanks!
- João Velasques answered 8 months ago
- You must login to post comments
Hi
I don’t think there is anything wrong with the CursorModifier here. The problem is that in your createFastLineRenderableSeries function you are setting dataIsSortedInX: true on the dataSeries, but this is not true for the green series. The hitTest uses a different search algorithm for sorted vs unsorted data, which is why you do not get sensible results.
Just remove the dataIsSortedInX config completely and SciChart will work out for itself if it is sorted or not and apply the correct hitTest. With that, I do not think you need the custom modifier at all.
Regards
David
- David Burleigh answered 10 months ago
- You must login to post comments
Please login first to submit.