views:

27

answers:

2

How do I change the color of the horizonal and vertical lines? I'd like to make them a little lighter, yet leave the X and Y axis black, probably.

alt text

Edited:

indyfromoz suggestion resulted in this: alt text

The effect I want is this: alt text

(Subtler horiz and vertical lines, maybe even no vertical lines.)

A: 

You have two options - use the Axis.IsInterlaced property or the Axis.StripLines property. This page is a handy reference for customization of the grid lines in a chart.

Here is some sample C# code (from the above reference) -

chart1.ChartAreas[0].AxisY.StripLines.Add(new StripLine()); 
chart1.ChartAreas[0].AxisY.StripLines[0].BackColor = Color.FromArgb(80, 252, 180, 65); 
chart1.ChartAreas[0].AxisY.StripLines[0].StripWidth = 40; 
chart1.ChartAreas[0].AxisY.StripLines[0].Interval = 10000; 
chart1.ChartAreas[0].AxisY.StripLines[0].IntervalOffset **

HTH, indyfromoz

indyfromoz
Thanks for the response. Please see my updated post. BTW, Was the last line (**) a typo , not sure what it means.
Velika
+2  A: 
        Chart1.ChartAreas(0).AxisY.MajorGrid.LineColor = Color.FromArgb(&H50, &H9C, &H9A, &H95)
        Chart1.ChartAreas(0).AxisX.MajorGrid.LineColor = Color.FromArgb(&H50, &H9C, &H9A, &H95)
Chad
Bingo. Sweet, to the point, and not the first thing that Google returned.
Velika