Pre loader

CursorModifier on flipped axis with multiple series

Welcome to the SciChart Forums!

  • Please read our Question Asking Guidelines for how to format a good question
  • Some reputation is required to post answers. Get up-voted to avoid the spam filter!
  • We welcome community answers and upvotes. Every Q&A improves SciChart for everyone

WPF Forums | JavaScript Forums | Android Forums | iOS Forums

1
1

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?

Version
3.1.333
  • Andrew Burnett-Thompson
    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 to post comments
0
0

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

  • You must to post comments
0
0

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!

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.