This is a migrated thread and some comments may be shown as answers.

Set Axis Color

5 Answers 149 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Jon
Top achievements
Rank 1
Jon asked on 04 Aug 2012, 02:51 PM
Hi..
Why does the following have no effect?
 chart.PlotArea.YAxis.Appearance.Color = System.Drawing.Color.Black;


I'm trying to set the X and Y axis to appear in black text.  But they still appear in the default gray'ish color.

any ideas?
thx

5 Answers, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 08 Aug 2012, 01:55 PM
Hi Jon,

As you talk about "appear in black text", I assume you want to change the color of the axis items and not the color of the Axis itself:

chart.PlotArea.YAxis.Appearance.TextAppearance.TextProperties.Color = System.Drawing.Color.Black;

Kind regards,
Steve
the Telerik team

BLOGGERS WANTED! Write a review about Telerik Reporting or the new Report Designer, post it on your blog and get a complimentary license for Telerik Reporting. We’ll even promote your blog and help bring you a few fresh readers. Yes, it’s that simple. And it’s free. Get started today >

0
Jon
Top achievements
Rank 1
answered on 08 Aug 2012, 02:10 PM
Hi..
I mean the x and y axis lines... 

thanks again

 See this pic

 

0
Steve
Telerik team
answered on 08 Aug 2012, 02:33 PM
Hello Jon,

The attached image still does not make it very clear which lines you talk about, so here is the code to make all Black. If this is not what you want, please use some pointers in the screenshot or say exactly which chart element you aim for as described in Chart Elements help article.

chart1.PlotArea.YAxis.Appearance.Color = System.Drawing.Color.Black;
chart1.PlotArea.YAxis.Appearance.MajorTick.Color = System.Drawing.Color.Black;
chart1.PlotArea.YAxis.Appearance.MinorTick.Color = System.Drawing.Color.Black;
chart1.PlotArea.XAxis.Appearance.Color = System.Drawing.Color.Black;
chart1.PlotArea.XAxis.Appearance.MajorTick.Color = System.Drawing.Color.Black;
chart1.PlotArea.XAxis.Appearance.MinorTick.Color = System.Drawing.Color.Black;
chart1.PlotArea.YAxis.Appearance.MajorGridLines.Color = System.Drawing.Color.Black;
chart1.PlotArea.YAxis.Appearance.MinorGridLines.Color = System.Drawing.Color.Black;
chart1.PlotArea.XAxis.Appearance.MajorGridLines.Color = System.Drawing.Color.Black;
chart1.PlotArea.XAxis.Appearance.MinorGridLines.Color = System.Drawing.Color.Black;

Regards,
Steve
the Telerik team

BLOGGERS WANTED! Write a review about Telerik Reporting or the new Report Designer, post it on your blog and get a complimentary license for Telerik Reporting. We’ll even promote your blog and help bring you a few fresh readers. Yes, it’s that simple. And it’s free. Get started today >

0
Jon
Top achievements
Rank 1
answered on 08 Aug 2012, 02:39 PM
Hi..
My axis lines are still gray...  The tick marks and text are black now.
I also need the vertical grid line to show.
thanks again
0
Hrisi
Telerik team
answered on 13 Aug 2012, 04:02 PM
Hello Jon,

Attached you can find a movie which demonstrates Chart Axes formatting with the designer instead of programmatic setup.

Kind regards,
Hrisi
the Telerik team

BLOGGERS WANTED! Write a review about Telerik Reporting or the new Report Designer, post it on your blog and get a complimentary license for Telerik Reporting. We’ll even promote your blog and help bring you a few fresh readers. Yes, it’s that simple. And it’s free. Get started today >

Tags
General Discussions
Asked by
Jon
Top achievements
Rank 1
Answers by
Steve
Telerik team
Jon
Top achievements
Rank 1
Hrisi
Telerik team
Share this question
or