Anything like IsZoomed?

Apr 30, 2010 at 7:03 PM

Is there anything like IsZoomed to tell if the ChartPlotter's Viewport is zoomed in or out from it's default state?

May 2, 2010 at 8:45 PM

The viewport has a property IsFittedToView that may be what you are after.

May 3, 2010 at 1:14 AM

Currently there is no such a property, but you can save two states of Viewport.Visible property and then compare it.


May 3, 2010 at 3:10 AM
Edited May 3, 2010 at 3:32 AM

Would it be to wrong to use something like this?


public Boolean isZoomedInOrOut
                NumericAxis horizAxis = plotter.MainHorizontalAxis as NumericAxis; // Choose your axis type
                if(horizAxis == null)
                    throw new NullReferenceException("X Axis is not of type Numeric Axis");

                Double zoomRange = horizAxis.AxisControl.Range.Max - horizAxis.AxisControl.Range.Min;
                if (zoomRange == 1.0)
                    return false;

                return true;

[Edited] removed dead code

May 4, 2010 at 2:03 AM

Hi, for the same goal you can use plotter.Viewport.Visible property, which was designed specially for such kind of things.