【发布时间】:2012-07-19 14:06:49
【问题描述】:
我正在使用以下代码来选择和缩放我的图表部分:
chart1.ChartAreas[0].CursorX.IsUserEnabled = true;
chart1.ChartAreas[0].CursorX.IsUserSelectionEnabled = true;
chart1.ChartAreas[0].AxisX.ScaleView.Zoomable = true;
chart1.ChartAreas[0].AxisX.ScrollBar.IsPositionedInside = true;
chart1.ChartAreas[0].CursorY.IsUserEnabled = true;
chart1.ChartAreas[0].CursorY.IsUserSelectionEnabled = true;
chart1.ChartAreas[0].AxisY.ScaleView.Zoomable = true;
chart1.ChartAreas[0].AxisY.ScrollBar.IsPositionedInside = true;
它适用于具有整数类型的 x 和 y 轴的图表。
但是当我将series值类型设置为series1.XValueType = ChartValueType.Time;时,我将无法放大x轴。
当我将两个轴值类型都设置为自动并使用例如chart1.Series[0].Points.AddXY(DateTime.Now.ToLongTimeString(), rand.Next(10, 20)); 添加点时,缩放就会起作用。
我怎样才能让我的 x 轴成为时间并且仍然能够缩放?
【问题讨论】: