Drag chart with right mouse button
Drag chart with right mouse button
The user can drag my chart using the right mouse button. How do I return the chart to the original position programatically? I would like the user to be able to double click on the chart and return to the original position. How can I do this?
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi gs,
Yes, this can be done using TeeChart's DoubleClick event like this:
Yes, this can be done using TeeChart's DoubleClick event like this:
Code: Select all
void tChart1_DoubleClick(object sender, EventArgs e)
{
tChart1.Zoom.Undo();
}
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 |
Hi Narcis, thanks for your reply. However, that's not quite what I had in mind.
If I hold the right mouse button down and drag the chart off to the right, for example, the graph moves and the axes move with it, so it's not really a zoom, and Zoom.Undo doesn't take the graph back to it's initial position. I want to reset the origin back to where it was and move the graph back as well
If I hold the right mouse button down and drag the chart off to the right, for example, the graph moves and the axes move with it, so it's not really a zoom, and Zoom.Undo doesn't take the graph back to it's initial position. I want to reset the origin back to where it was and move the graph back as well
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi gs,
Even the chart is not zoomed Zoom.Undo resets the chart for me here using latest TeeChart for .NET v3 release. Anyway, another option is saving initial left and bottom axes minimum and maximum values to local variables and restore them using Axis.SetMinMax() when the user double-clicks the chart.
Hope this helps!
Even the chart is not zoomed Zoom.Undo resets the chart for me here using latest TeeChart for .NET v3 release. Anyway, another option is saving initial left and bottom axes minimum and maximum values to local variables and restore them using Axis.SetMinMax() when the user double-clicks the chart.
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 |