Using TChart 8.0 in MSVC 2008.
The documentation I have gives an example of using ZoomRect as follows
//zoom in
TChart1.Zoom.ZoomRect 5, 5, TChart1.Width - 5, TChart1.Height - 5
// zoom out
TChart1.Zoom.ZoomRect - 5, - 5, TChart1.Width + 5, TChart1.Height + 5
which leads me to believe the following would have no affect on the chart:
// no zoom
TChart1.Zoom.ZoomRect 0, 0, TChart1.Width, TChart1.Height
However all of these when converted to C++ (Chart.GetZoom().ZoomRect...) result in zooming out, never in.
So, my question is, how can I find the current zoom rectangle?
For my current purpose I can get around this using zoompercent and playing games with the axis extents, but zoomrect offers a much simpler solution (if I can figure out how it works).
Thanks,
Jeff Bell
ZoomRect units
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Jeff,
ZoomRect uses pixels, code below works fine for me here:
You should have in mind that you should perform zoom in the chart drawing area, which by default is defined by chart axes:
Zooming the exact drawing area would do nothing as it's the view you already have.
Hope this helps!
ZoomRect uses pixels, code below works fine for me here:
Code: Select all
void CV8ExampleDlg::OnButton1()
{
m_Chart1.GetZoom().ZoomRect(100, 100, 300, 300);
}
Code: Select all
m_Chart1.GetZoom().ZoomRect(m_Chart1.GetAxis().GetLeft().GetPosition() + 10,
m_Chart1.GetAxis().GetLeft().GetIStartPos() + 10,
m_Chart1.GetAxis().GetBottom().GetIEndPos() - 10,
m_Chart1.GetAxis().GetBottom().GetPosition() -10);
Hope this helps!
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |