SciChart¬ģ the market leader in Fast WPF Charts, WPF 3D Charts, and now iOS Charting & Android Chart Components

Welcome to the SciChart Community Forums!

Please use the forums below to ask questions about SciChart. Take a moment to read our Question asking guidelines on how to ask a good question and our support policy

We also have a tag=SciChart on Stackoverflow.com where you can earn rep for your questions!

Answered
1
2

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?

Thanks
Matt

Version
3.1.x.x
  • 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
1
0

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,
Andrew

  • 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.