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
0
0

Hi,

I have a simple chart with FastLineRenderableSeries with a DateTime X axis and a numeric Y axis. I’ve also added a RubberBandXyZoomModifier and a ZoomExtentsModifier. In this chart I want to be able to zoom out to previous visible range. E. g. the user use the rubber band to zoom in to range A, then he zooms in a second time to range B, then he should have the opportunity to zoom out from range B and back to range A. Do you have a recommendation for how I can achieve this?

My first thought was to override the ZoomExtensModifier to allow the user to both use the full zoom out functionality, and also, by holding shift or something, zoom out to previous. In addition I can handle the VisibleRangeChanged event to collect the ranges.

Then I noticed that the VisibleRangeChanged event always seems to get fired twice after a user modification of the visible range. For example if I test with a slightly modified version of the line chart in http://http://www.scichart.com/documentation/webframe.html#BuildingASimpleLineChart.html, and zoom from X (205,431) to (250,300); the first time VisibleRangeChanged is fired the e.NewVisibleRange is (215,404), the second time it is as expected (250,300). Why is that? Will it always fire two times, or can I also expect it to fire one or three times? Is this something that can or will change in future releases of scichart?

  • Olav
  • You must to post comments
Best Answer
4
0

SciChart v3.0 now allows detection of whether VisibleRangeChanged was fired during animation or not. Try this code below:

public void Foo()
{
    var axis = new NumericAxis();

    axis.VisibleRangeChanged += (s, e) =>
        {
            if (e.IsAnimating)
            {
                // VisibleRangeChanged occurred during animation                        
            }
            else
            {
                // VisibleRangeChanged did not occur during animation
            }
        };
}
  • You must to post comments
1
0

Hi there,

Thanks for reporting that behavior with VisibleRangeChanged event. We logged it in our bug tracker for further investigation. I think it happens because of animation turned on, you could turn it off using IsAnimated property of some modifiers.

Regarding zoom history, there were few similar requests, and one SciChart customer kindly posted theirs implementation in this post. You probably find there something useful for yourself.

Please, feel free to ask if you have any questions,

Best regards,
Yuriy

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.