How do I force a chart to auto adjust Y Axis Maximum?

前端 未结 4 806
梦谈多话
梦谈多话 2021-01-07 17:52

I have a .NET chart which I am populating at runtime

The chart appears within a report. For each band in my report, I clear all the series and add them back in usin

4条回答
  •  时光说笑
    2021-01-07 18:13

    you need to run this sequence:

    AxisY.Maximum = Double.NaN; // sets the Maximum to NaN
    AxisY.Minimum = Double.NaN; // sets the Minimum to NaN
    enter code herechart.ChartAreas[0].RecalculateAxesScale(); // recalculates the Maximum and Minimum values, since they are set to NaN
    

提交回复
热议问题