Pre loader

Switch y-axes during run time as function of series hit-test

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


I have multiple series on a chart surface, each with their own y-axis. I do not want to display all y-axes as this would take up half the chart surface.

Is there a way to make the matching y-axis only visible when the mouse cursor hovers over a series (hit-test)? How would I go about that?


  • Paul Frivold
    That sounds very possible, and like a decent solution to having multiple y-axes take up tons of space. I wonder if completely hiding them might be a bad idea, especially if you’d like the user to be able to interact with the axes at all. I haven’t looked into the hit-test stuff too much, but once you get the y-axis you should be able to hide it by setting DrawLabels, DrawMajorTicks, and DrawMinorTicks to false. As a side note, you might get away with just hiding the Axis Titles, they take up about half the size of each axis… I know there’s an answered question about how to do that somewhere on here.
  • bbmat
    @Paul, the problem is not the hiding/collapsing of the yAxes. The problem is the binding/linking between a selected series and the Visibility property of the YAxis that is linked via axisID to the renderableseries of the selected series. I preferably want to do that in xaml, only.
  • You must to post comments
Best Answer

Hi Mat

This is impossible in Xaml only. But I appreciate the sentiment of being a Xaml purist 🙂

You are going to have to write a custom ChartModifierBase derived class.

  1. Override OnModifierMouseMove
  2. In the mouse move event, iterate over RenderableSeries, call RenderableSeries.HitTest
  3. The returned HitTestInfo has a property: IsHit. When IsHit is true, set RenderableSeries.YAxis.Visibility=Visible. Set all other RenderableSeries.YAxis.Visibility = Collapsed.

Let me know if this helps

Best regards,

  • bbmat
    @Andrew, awesome, exactly what the doctor prescribed. Thanks a lot.
  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.

Try SciChart Today

Start a trial and discover why we are the choice
of demanding developers worldwide

Start TrialCase Studies