我想放大图表
private void toolStripButtonZoom_Click(object sender, System.EventArgs e)
{
double posXStart = chartMain.ChartAreas[0].AxisX.PixelPositionToValue(e.Location.X) - (xMax - xMin) / 0.5;
double posXFinish = chartMain.ChartAreas[0].AxisX.PixelPositionToValue(e.Location.X) + (xMax - xMin) / 0.5;
double posYStart = chartMain.ChartAreas[0].AxisY.PixelPositionToValue(e.Location.Y) - (yMax - yMin) / 0.5;
double posYFinish = chartMain.ChartAreas[0].AxisY.PixelPositionToValue(e.Location.Y) + (yMax - yMin) / 0.5;
chartMain.ChartAreas[0].AxisX.ScaleView.Zoom(posXStart, posXFinish);
chartMain.ChartAreas[0].AxisY.ScaleView.Zoom(posYStart, posYFinish);
}
它无法识别“位置”并给出此错误。