How to restrict zooming or restrict graph moving with mouse?

Aug 31, 2010 at 1:18 PM

Hi ,

i am using chartplotter control in wpf. I want to restrict the zooming effect or restricting the graph sliding with mouse. i want to show the graph fixed with out giving a chance to the user to move the graph.

can u please gave me a code for this.

 

Thanks & Regards

Srujana

 

 

Aug 31, 2010 at 3:51 PM

As mentioned in the previous answer about setting the origin you need to modify or remove the mouse and keyboard navigation objects. One way to do that is:

plotter.Children.RemoveAll<IPlotterElement>(plotter.MouseNavigation.GetType()); 
plotter.Children.RemoveAll<IPlotterElement>(plotter.KeyboardNavigation.GetType()); 

Note that while this prevents keyboard and mouse panning/zooming on the graph it still allows the panning/zooming on the horizontal and vertical axes. I'll leave it as an excersize for the reader to disable these