winformsmschart

Remove Left Margin of Microsoft Chart Control


How to remove the left margin of a Microsoft Chart Control (Shown as a red rectangle)?

The chart control is docked in the parent form. It seems that this margin is dynamic and depends on the chart width.

I cannot find such an option. Do I need to work with ChartArea location?

enter image description here

This is a .NET C#, WinForms application.


Solution

  • The following code worked for me:

        Chart1.ChartAreas[0].Position.X = 0;