How to Hide/Show Gridlines for Charts in a PowerPoint Presentation in C#?

Hi Team,

I am trying to hide/show gridlines but i am unable to find an option.

I can see a property chart.Axes.VerticalAxis.ShowMajorGridLines , but it is a ready only property.

How can i manipulate this feature of powerpoint?

Thanks.

@siddhanntarora,

I have observed your comments. Can you please set fill format to none and if there is still an issue than please share feedback with us.

@Adnan.Ahmad Could you please share the syntax?

And what is the way to hide/show the gridlines?

@siddhanntarora,

I have observed your comments. Below code snippet will help you to achieve your requirements. Pleas share feedback with us if there is still an issue.

chart.Axes.HorizontalAxis.MajorGridLinesFormat.Line.FillFormat.FillType = FillType.NoFill;

How can I hide/disable the verticle axis line for a line chart? basically, I need to display numbers not axis line.

@s1pandey,
Welcome to our community! Thank you for the query. You can hide the vertical axis for the line chart as below:

chart.Axes.VerticalAxis.Format.Line.FillFormat.FillType = FillType.NoFill;

More examples: Chart Axis, Chart Formatting
API Reference: IAxis Interface, ILineFillFormat Interface

Thankyou Andrey