How to restrict panning / Zooming in horizontal and vertical axis?

Sep 1, 2010 at 6:27 AM

Hi

Thank you for the Reply.

I tried to restrict the panning/Zooming on horizontal and vertical axes but no luck.

can u please send me a code for that.

once again thank you for your replies.

 

Thanks & Regards

Srujana

Sep 2, 2010 at 3:08 AM

Just remove the AxisNavigation objects from the ChartPlotter's children

Sep 9, 2010 at 9:32 PM
Edited Sep 9, 2010 at 9:33 PM
Here is an example code
Zoom in restriction:
private void SetZoomInConstraint(double minResXAxis,double minResYAxis)
        {
            HWZoomInRestriction zoomInRestriction = new HWZoomInRestriction(minResXAxis, minResYAxis);
            plotter.Viewport.Constraints.Add(zoomInRestriction);
        }

Zoom out restriction: 
public void SetZoomOutConstraint(double xAxisMinValue, double yAxisMinValue, double xAxisMaxRange, double yAxisMaxRange)
        {
            Microsoft.Research.DynamicDataDisplay.DataRect dataRect = 
                new Microsoft.Research.DynamicDataDisplay.DataRect( xAxisMinValue,  yAxisMinValue,  xAxisMaxRange,  yAxisMaxRange);                
            plotter.Viewport.Domain = dataRect; // Zoom out restriction
        }
Thanks
Kishore Vanapalli