Unzoom not correctly displaying the min max values
Posted: Thu Oct 05, 2006 1:16 pm
Hi
I need to capture the min and max values of the axis when doing a zoom and unzoom. Attached to following code for the Zoom and UnZoom events
private void chart_Zoomed(object sender, EventArgs e)
{
lblMinAbsTime.Text = System.TimeZone.CurrentTimeZone.ToLocalTime(DateTime.FromOADate(chart.Axes.Bottom.Minimum)).ToString("dd-MMM-yyyy HH:mm:ss");
lblMaxAbsTime.Text = System.TimeZone.CurrentTimeZone.ToLocalTime(DateTime.FromOADate(chart.Axes.Bottom.Maximum)).ToString("dd-MMM-yyyy HH:mm:ss");
}
private void chart_UndoneZoom(object sender, EventArgs e)
{
lblMinAbsTime.Text = System.TimeZone.CurrentTimeZone.ToLocalTime(DateTime.FromOADate(chart.Axes.Bottom.Minimum)).ToString("dd-MMM-yyyy HH:mm:ss");
lblMaxAbsTime.Text = System.TimeZone.CurrentTimeZone.ToLocalTime(DateTime.FromOADate(chart.Axes.Bottom.Maximum)).ToString("dd-MMM-yyyy HH:mm:ss");
}
When a zoom occurs the labels will display the correct values. If I create a button an attach the following code
chart.Zoom.Undo();
The chart will correctly reset to the original display and the event will fire but the min and max will not change from the zoomed values. I wait a second and press the button again to do a chart.Zoom.Undo(); and the values will then display the correct unzoom values.
I need to capture the min and max values of the axis when doing a zoom and unzoom. Attached to following code for the Zoom and UnZoom events
private void chart_Zoomed(object sender, EventArgs e)
{
lblMinAbsTime.Text = System.TimeZone.CurrentTimeZone.ToLocalTime(DateTime.FromOADate(chart.Axes.Bottom.Minimum)).ToString("dd-MMM-yyyy HH:mm:ss");
lblMaxAbsTime.Text = System.TimeZone.CurrentTimeZone.ToLocalTime(DateTime.FromOADate(chart.Axes.Bottom.Maximum)).ToString("dd-MMM-yyyy HH:mm:ss");
}
private void chart_UndoneZoom(object sender, EventArgs e)
{
lblMinAbsTime.Text = System.TimeZone.CurrentTimeZone.ToLocalTime(DateTime.FromOADate(chart.Axes.Bottom.Minimum)).ToString("dd-MMM-yyyy HH:mm:ss");
lblMaxAbsTime.Text = System.TimeZone.CurrentTimeZone.ToLocalTime(DateTime.FromOADate(chart.Axes.Bottom.Maximum)).ToString("dd-MMM-yyyy HH:mm:ss");
}
When a zoom occurs the labels will display the correct values. If I create a button an attach the following code
chart.Zoom.Undo();
The chart will correctly reset to the original display and the event will fire but the min and max will not change from the zoomed values. I wait a second and press the button again to do a chart.Zoom.Undo(); and the values will then display the correct unzoom values.