我正在使用图表(system.windows.forms.datavisualization.Charting.ChartArea
)构建winforms应用程序。此图表中的系列在AxisX
上有日期/时间,并在AxisY
上浮动。
无论我在ScaleView.MinSize
上ScaleView.MinSizeType
和AxisX
尝试什么设置,它总是像设置为1天一样
chartArea1.AxisX.Enabled = System.Windows.Forms.DataVisualization.Charting.AxisEnabled.True;
chartArea1.AxisX.LabelStyle.Format = "dd MMM\nHH:mm";
chartArea1.AxisX.ScaleView.MinSize = 0.001D;
chartArea1.AxisX.ScaleView.MinSizeType = System.Windows.Forms.DataVisualization.Charting.DateTimeIntervalType.Days;
chartArea1.AxisX.ScaleView.SizeType = System.Windows.Forms.DataVisualization.Charting.DateTimeIntervalType.Hours;
chartArea1.AxisX.ScaleView.SmallScrollMinSize = 15D;
chartArea1.AxisX.ScaleView.SmallScrollMinSizeType = System.Windows.Forms.DataVisualization.Charting.DateTimeIntervalType.Minutes;
chartArea1.AxisX.ScaleView.SmallScrollSize = 15D;
chartArea1.AxisX.ScaleView.SmallScrollSizeType = System.Windows.Forms.DataVisualization.Charting.DateTimeIntervalType.Minutes;
chartArea1.AxisX2.Enabled = System.Windows.Forms.DataVisualization.Charting.AxisEnabled.False;
chartArea1.AxisX2.ScaleView.SmallScrollMinSizeType = System.Windows.Forms.DataVisualization.Charting.DateTimeIntervalType.Hours;
chartArea1.AxisX2.ScaleView.SmallScrollSize = 15D;
chartArea1.AxisX2.ScaleView.SmallScrollSizeType = System.Windows.Forms.DataVisualization.Charting.DateTimeIntervalType.Minutes;
chartArea1.AxisY.Enabled = System.Windows.Forms.DataVisualization.Charting.AxisEnabled.True;
chartArea1.AxisY.ScaleView.MinSize = 1D;
chartArea1.AxisY.ScaleView.MinSizeType = System.Windows.Forms.DataVisualization.Charting.DateTimeIntervalType.Number;
chartArea1.AxisY.ScaleView.SmallScrollMinSizeType = System.Windows.Forms.DataVisualization.Charting.DateTimeIntervalType.Number;
chartArea1.AxisY.ScaleView.SmallScrollSize = 1D;
chartArea1.AxisY.ScaleView.SmallScrollSizeType = System.Windows.Forms.DataVisualization.Charting.DateTimeIntervalType.Number;
chartArea1.AxisY2.Enabled = System.Windows.Forms.DataVisualization.Charting.AxisEnabled.False;
chartArea1.CursorX.IsUserEnabled = true;
chartArea1.CursorX.IsUserSelectionEnabled = true;
chartArea1.CursorY.IsUserEnabled = true;
chartArea1.CursorY.IsUserSelectionEnabled = true;
数据类型为float的 AxisY
正常工作。 SmallScrollSize
AxisX
上的ScaleView.MinSize
工作正常。但为什么{{1}}让我感到不安?
答案 0 :(得分:1)
问题是由光标间隔引起的。默认设置为1,因此我无法选择小于1(天)的间隔。通过将间隔更改为0.01(14.4分钟),这不再是一个问题。
chartArea1.CursorX.Interval = 0.01D;