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!

Please note: SciChart team will only answer questions from customers with active support subscriptions. Expired support questions will be ignored. If your support status shows incorrectly, contact us and we will be glad to help.

Answered
1
0

Hi,
I have a SciChartSurfacewith one xaxis an four yaxis and a dynamic number of series which are added at runtime.
Also I have some modifiers especially the ZoomExtentsModifier( ExecuteOn=”MouseDoubleClick” XyDirection=”XDirection”) and for each yaxis a yaxisdragmodifier.
Is it possible to double click on a single yaxis and ZoomExtends only this yaxis?

Regards Markus

  • You must to post comments
Best Answer
1
0

Hi Markus,

I think you’ll need to create a custom modifier to do this, but it shouldn’t be too hard. Head over to our KnowledgeBase to see articles on Custom Chart Modifiers.

If you come up with a good solution, feel free to post it here as a code sample!

Best regards,
Andrew

  • Auer Markus
    Perfect, that's a good starting point. Thank You!
  • You must to post comments
Great Answer
1
0

So here is my CustomZoomExtendsModifier:

Depending on where you make a double click (Chart, XAxis, YAxis) it zooms to its maximum range.

public class CustomZoomExtendsModifier : ChartModifierBase
{
    public override void OnModifierDoubleClick(ModifierMouseArgs e)
    {
        bool isOnChart = IsPointWithinBounds(e.MousePoint, ModifierSurface);

        foreach(var yAxis in YAxes)
        {
            if(IsPointWithinBounds(e.MousePoint, yAxis))
            {
                var range = yAxis.GetMaximumRange();
                yAxis.AnimateVisibleRangeTo(range, TimeSpan.FromMilliseconds(500));
            }             
        }

        foreach(var xAxis in XAxes)
        {
            if(IsPointWithinBounds(e.MousePoint, xAxis))
            {
                var range = xAxis.GetMaximumRange();
                xAxis.AnimateVisibleRangeTo(range, TimeSpan.FromMilliseconds(500));
            }             
        }

        if(isOnChart)
        {
            this.ParentSurface.AnimateZoomExtents(TimeSpan.FromMilliseconds(500));
        } 

        e.Handled = true;
        base.OnModifierDoubleClick(e);
    }
}

Regards Markus

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.