How can I reduce the height of an mschart like this:
[EDIT] In my case I do not want break chart view.
this.chart1.ChartAreas.AxisY.ScaleBreakStyle.Enabled = false;</pre>
You seem to be looking for
Here is an example:
Series s = chart1.Series; ChartArea ca = chart1.ChartAreas; Axis ay = ca.AxisY; s.ChartType = SeriesChartType.Line; for (int i = 0; i < 100; i++) s.Points.AddXY(i, rnd.Next(100) + 50 ); s.Points.AddXY(s.Points.Count, 123456); ay.ScaleBreakStyle.Enabled = true; // <<<=== enable or disable! ay.ScaleBreakStyle.LineWidth = 1; ay.ScaleBreakStyle.LineColor = Color.OrangeRed; ay.ScaleBreakStyle.StartFromZero = StartFromZero.Auto; ay.ScaleBreakStyle.Spacing = 2; ay.ScaleBreakStyle.StartFromZero = StartFromZero.Auto;
Note that there a quite a few cases where it will not work. MSDN:
Scale breaks are not supported under any of the following conditions:
Pie, doughnut, funnel, pyramid, radial or any stacked chart types are used.</li> <li>
Custom intervals for labels, tick marks or grid lines are enabled.</li> <li>
The minimum or maximum value for the axis is set.</li> <li>
Custom labels are used.</li> <li>
A logarithmic Y-axis is specified.</li> <li>
Axis views on the Y-axis, which include scrolling and zooming, are used.</li> <li>
3-D charts are used.</li> </ul>
<strong>Update:</strong> Of course you can also <strong>disable</strong> the break at runtime..