I been trying to make the zoom out work by getting array of x-axis and y-axis, so that when i click zoom out button, i call that x and y axes' mins and maxs. But it seem to not to work.
it doesn't do anything when i click the button.
Here is my codes
 
 void CFinal1Dlg::ZoomCwgraphTop()
 {
        UpdateData(true);
  CNiAxis xAxis = m_graph_top.Axes.Item("XAxis");
  range_top=xMax_top-xAxis.Maximum+xAxis.Minimum;
  scrollrange_top = (int)findScrollRange(range_top);
  m_hscrollbar_top.SetScrollRange(0,scrollrange_top,true);
  m_hscrollbar_top.SetScrollPos((int)(xAxis.Minimum/range_top*scrollrange_top),true);
  m_hscrollbar_top.ShowWindow(SW_SHOW);
  CNiAxis lastTopXAxis=m_graph_top.Axes.Item("XAxis");
  CNiAxis lastTopYAxis=m_graph_top.Axes.Item("YAxis-1");
  topAxes[topZoomed][0]=lastTopXAxis.Minimum;
  topAxes[topZoomed][1]=lastTopXAxis.Maximum;
  topAxes[topZoomed][2]=lastTopYAxis.Minimum;
  topAxes[topZoomed][3]=lastTopYAxis.Maximum;
  topZoomed++;  
 }
void CFinal1Dlg::OnBnClickedBtnTopZoomout()
{
 if(topZoomed>0)
 {
 topZoomed--;
 m_graph_top.Axes.Item("XAxis").SetMinMax(topAxes[topZoomed][0],topAxes[topZoomed][1]);
 m_graph_top.Axes.Item("YAxis-1").SetMinMax(topAxes[topZoomed][2],topAxes[topZoomed][3]);
 }
}
Can anyone help me....
i am using MFC dialog-based CNiGraph in VC++ Pro 2003....
Thank you~!!