Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MS Chart Controls: Position grid lines between labels

Is there a possibility to format a MS Chart Control chart, that the axis label is rendered between major/minor tick marks?

E.g.: on the X axis

|       |       |   x   |       |
|   x   |   x   |       |       |
|       |       |       |   x   |
+-------+-------+-------+-------+
   1/1     2/1     3/1     4/1   

instead of default:

|       |       |       x       | 
|       x       x       |       | 
|       |       |       |       x 
+-------+-------+-------+-------+----
       1/1     2/1     3/1     4/1   
like image 879
puco Avatar asked Jul 12 '10 19:07

puco


People also ask

How do I change the grid lines in an Excel chart?

Click the chart, and then click the Chart Design tab. Click Add Chart Element > Gridlines. Choose the axis that you want to apply the gridlines to or click More Gridline Options to open the Format Major Gridlines pane. You can change the line transparency, add arrows, and apply shadow, glow, and soft edge effects.

Which of the following tabs allows you to modify data labels and gridlines?

In Excel 2007-2010, go to the Chart Tools > Layout tab > Data Labels > More Data label Options.


1 Answers

Try setting the MajorGrid IntervalOffset to .5 (assuming your Interval is set to 1). Here is some example markup (this markup would be found under the /asp:Chart/ChartAreas/asp:ChartArea nodes):

<AxisX Interval="1"> <MajorGrid Enabled="True" LineColor="Black" Interval="1" IntervalOffset=".5" /> </AxisX>

like image 183
Bob Whitley Avatar answered Oct 25 '22 12:10

Bob Whitley