我有一个 Winforms 图表,其中每秒都有温度读数到达并显示。我喜欢图表自动处理值显示的工作方式,但我想改变一件简单的事情。
我想增加最小显示的 y 轴范围,所以它显示的范围是 20。目前它只显示大约 5。我尝试了一些事情:
//(when new data arrives...)
//Does not work, I think because by default, Size is always NaN?
if (chart1.ChartAreas[0].AxisY.ScaleView.Size < 20)
{
chart1.ChartAreas[0].AxisY.ScaleView.Size = 20;
}
Run Code Online (Sandbox Code Playgroud)
这些都不起作用:
chart1.ChartAreas[0].AxisY.ScaleView.SmallScrollMinSize = 20;
chart1.ChartAreas[0].AxisY.ScaleView.SmallScrollSize = 20;
chart1.ChartAreas[0].AxisY.ScaleView.MinSize = 20;
chart1.ChartAreas[0].AxisY.Minimum //doesn't seem to have any effect
chart1.ChartAreas[0].AxisY.Maximum //doesn't seem to have any effect
Run Code Online (Sandbox Code Playgroud)
我确定我错过了一些简单的东西。我希望无论如何我都有。