Search code examples
c#winformschartsscaleautoresize

How to disable Chart axis autosize


I need to stop autosizing (or autoscaling) of Y Axis in c# chart and set it manually. Any advice? Thanks


Solution

  • You can set the minimum and maximum of the Y axis like so:

    chart.ChartAreas[0].AxisY.Minimum = 0;
    chart.ChartAreas[0].AxisY.Maximum = 10;