0

Default when I zoom some chart it appears in the upper-left and bottom-left corner zoom-out buttons.

When I click them they worked like step back. For example if I make zoom-in 5 times, then I must click zoom-out also 5 times, etc.

How to adjust zoom-out to recede scale 2times on each click independent of zoom-in history.

4

1 回答 1

0

您需要为 AxisScrollBarClicked 实现一个处理程序:

chart1.AxisScrollBarClicked += new ScrollBarEventHandler(this.chart1_AxisScrollBarClicked);
...

private void chart1_AxisScrollBarClicked(object sender, ScrollBarEventArgs e)
{
  // Handle zoom reset button
  if(e.ButtonType == ScrollBarButtonType.ZoomReset)        
  {
    e.IsHandled = true;

    double x_view_start, x_view_end, y_view_start, y_view_end;
    // calculate the zooming params here according to desired behaviour

    e.ChartArea.AxisX.ScaleView.Zoom(x_view_start, x_view_end);
    e.ChartArea.AxisY.ScaleView.Zoom(y_view_start, y_view_end);
  }
}
于 2012-07-10T08:30:37.543 回答