Pre loader

Rollover verical line stays after the modifier is disabled

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

Answered
1
0

Hello

I am trying to add RolloverModifier to my chart. I want it to be enabled when any of the FastLineRenderableSeries is selected. I managed to do this with onSelectedChanged property. I simply set
it like: rolloverModifier.isEnabled = isSelected;

But there’s one problem – when the RolloverModifier is disabled on selecting the series the vertical line stays attached to the chart, it doesn’t move with cursor and doesn’t show tooltips, but it’s on the chart.

I would really appreciate help with that.
Maybe there’s a way to “manually” detach the line?

Version
3.5.711
Images
  • You must to post comments
Best Answer
0
0

Hi
At the moment, all isEnabled on RolloverModifier actually does is stop it receiving new mouse events, effectively locking it in place but not removing it. To stop and hide it without actually removing it (which is the ideal) you need to do

rolloverModifier.isEnabled = false;
rolloverModifier.showRolloverLine = false;
rolloverModifier.showTooltip = false;

If you want to do this when any series is selected, you should drive it off the SeriesSelectionModifier’s onSelectionChanged. eg

new SeriesSelectionModifier({ onSelectionChanged: (data) => {
    const enabled = data.selectedSeries.length > 0;
    rolloverModifier.isEnabled = enabled;
    rolloverModifier.showRolloverLine = enabled;
    rolloverModifier.showTooltip = enabled;
})

This fires once per mouse event, whereas series.onSelectedChanged will fire for the selected and deselected series, so depending on the order you may not end up in the state you expect.

Regards
David

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.