Search code examples
c#mschart

How can I hide vertical line


line

I want to remove the lines I showed in the picture Because it is a very absurd views (not only marked two)

result

I am trying this code but it does not do anything

chart1.ChartAreas.First().AxisX.LineColor = Color.FromArgb(50, Color.Black);
chart1.ChartAreas.First().AxisX.LineWidth = 0;
chart1.ChartAreas.First().AxisX.InterlacedColor = Color.White;

I am changing Interval like this , it working but above code does not work

chart1.ChartAreas.First().AxisX.Interval = 1;

Solution

  • The answer from How to delete grid lines from Chart in WindowsForm?

    chart1.ChartAreas[0].AxisX.MajorGrid.LineWidth = 0;