How to disable grid lines?

How to disable grid lines but still have labels? I tried with ChartAxis.LineStroke setting Pen.Brash to Transparent but with no success. I also tried to set Pen.Thikness to 0 with no luck.


3 Replies

AD Administrator Syncfusion Team January 29, 2008 05:57 AM UTC

Hi Mike,

You can use the dependency property of ChartArea in the ChartAxis markup extension to disable the GridLines. The following code shows how to set GridLines property to false.

[XAML]


...
...




[C#]


ChartArea.SetShowGridLines(myChart.Areas[0].PrimaryAxis,false);


Similary you can set GridLines to false for Secondary axis also.

Let me know if you have any queries

Thanks for your interest in Syncfusion products.

Regards,
Asem.




MM Matt Machalinski July 13, 2011 06:31 PM UTC

How do you change the color of these lines? I changed the tick color, but that only changes the actual tick color that is outside of the grid area.



MP Muralidharan P Syncfusion Team July 18, 2011 03:27 PM UTC

Hi Asem,

Thanks for using Syncfusion products.

We can change the gridlines color by using the dependency property GridLineStroke of ChartArea in the ChartAxis. The following code shows how to change the color of GridLines.

[XAML]









Similary you can set GridLines color for Secondary axis also. Based on your requirement we have created a simple sample and the same can be downloaded from the following location.

http://www.syncfusion.com/uploads/redirect.aspx?&team=support&file=WPF-1485564506.zip

Let me know if you have any queries

Regards ,
Muralidharan.




Loader.
Up arrow icon