This project is read-only.

How to modify the Y-Axis range to center the line graph

Aug 5, 2010 at 10:09 PM

D3 works correctly; however I have a specific requirement that I am looking to achieve. When I zoom in on the X-Axis using a mouse scroll the the Line Graph zooms on the X-Axis (pretty standard with D3). If you look at the images below you see that the zoom on the X-Axis expands the Line graph horizontally and eventually pushes the line graph to the top of the plot area.

In my application the zoom happens because of the use interaction with the application and not because of the user interaction with the graphs. The plotter Viewport is set from within the application depending upon the user activity in the application.

To zoom on a particular graph area, I set the plotter.Viewport.Visible to a new Rect. I provide the rect with new XMin and Width but re-use the Ymin and width from the plotter itself and hence the range nevers gets updated. I really need the graph to show up as below 

How do I get the YAxis range for the X-Axis range I am interacting with?

Thanks

Kishore Vanapalli

Aug 5, 2010 at 11:01 PM

You can get the data from

graph.DataSource.GetPoints()

and then find the points that match the displayed frequency range and find their phase.

The code could be called from within a PropertyChanged callback on the plotters viewport that is monitoring the Visible property.

 

 

Aug 6, 2010 at 3:35 AM

Awesome i think that is working

 

Kishore Vanapalli