Quinn-Curtis Forums
Quinn-Curtis Forums
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Tools for Microsoft .Net & .Net Compact Framework
 QCChart2D and QCChart2D CF (VB and C#)
 Zoom to location
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Benlehman

6 Posts

Posted - 16 Feb 2010 :  11:57:15  Show Profile  Reply with Quote
I was wondering if there is any way to Zoom to a specific location. I need to allow the user to enter in a upper bound Point and a lower bound Point and have the chart zoom to the resulting rectangle. I couldn't find any way to do this in the ChartZoom class. If there is not currently a way can you suggest anything? The only thing I an think of is to fake the MouseDown, MouseMove and MouseUp events, but that would require me to translate the values the user entered to screen coordinates in order to get the X and Y values needed for the event calls. I dont know if it would even be possible to translate the points and I have to imagine there is an easier way. An example of this would be: the user selects X:10, Y:5 and X:20, Y:10. The chart would need to zoom so that those points are the bounds for the current scaling.

Once again thank you so much for your help.

quinncurtis

1164 Posts

Posted - 16 Feb 2010 :  13:15:47  Show Profile  Reply with Quote
Sorry, we can't follow your premise. How is "I need to allow the user to enter in a upper bound Point and a lower bound Point and have the chart zoom to the resulting rectangle" different than zooming? How do you expect the user to enter upper bound Point and lower bound Point, if not by dragging a zoom rectangle, as in zooming?
Go to Top of Page

quinncurtis

1164 Posts

Posted - 16 Feb 2010 :  14:27:25  Show Profile  Reply with Quote
If you are just looking for way to change the scale of the chart, with user defined values, this would work. It has nothing to do with the zoom class.

// xmin, ymin, xmax, and ymax store new physical coordinates
Rectangle2D r = new Rectangle2D();
r.SetFrameFromDiaglonal(xmin, ymin, xmax, ymax)
pTransform1.SetPhysScale(r);


You would of course have to autocalc the axes parameters.

xAxis.CalcAutoAxis();
yAxis.CalcAutoAxis();
xAxisLab.CalcAutoAxisLabels();
yAxisLab.CalcAutoAxisLabels();
this.UpdateDraw();

There are many examples of this type of thing in the software. Anywhere a scrollbar or button changes the current scale of the chart.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Quinn-Curtis Forums © 2000-07 Quinn-Curtis, Inc. Go To Top Of Page
Powered By: Snitz Forums 2000 Version 3.4.07