This project is read-only.

WPF ChartPlotter zoom only the X-Axis

Jan 13, 2013 at 1:42 PM
Edited Jan 13, 2013 at 1:44 PM

How can i make the ChartPlotter zoom effect only the X-Axis, while the Y-Axis stays the same?

Jan 16, 2013 at 4:52 AM


Its not possible to zoom for only one Axis. (I didn't check in the latest version).

You can write your own custom zooming. It is very easy to write custom zooming and you will havev full control over zooming. I did it for my application.



Jan 18, 2013 at 3:17 PM

I am interested in customizing zoom and pan behavior in WPF version of D3.  Can someone post an example of how to do this? When a user pans or zooms, I need to repopulate plotter with more details (e.g., denser curve data then shown at home view).




Jan 23, 2013 at 5:19 AM


You can do some thing like this,

In mouse down event , when mouse is clicked -

  • store mouse positions
  • Create VerticalRange/HorizontalRange
  • Add this to chart children

Move the mouse

  • When mouse is moved , Change the Value2 of VerticalRange/HorizontalRange( This is to indicate that you are making zoom)

When Mouse is Up

  • Remove VerticalRange/HorizontalRange from Char Children
  • Make New View port Rect with old mouse position(i.e Mouse position when you Press mouse down) and mouse positions at mouse Up time
  • Update Chart ViewPort with the new View Port -some thing like this new Rect(xmin, 0, xmax-xmin, 100)
  • Change Axis limits like "AxisY.SetConversion(0, ymin,100, ymax)" ---- (This conversion is with respect to 0,100)R

Best Regards


Feb 7, 2013 at 6:12 AM
Hi Ravi,

can you please send me or add to your message a full example in code of custom zoom.

Feb 15, 2013 at 8:56 AM

I will try in to do it in couple of days.