I'm using MSCharts and am using dates for the axes and couldn't help but notice that the axis label is hidden for the last grid line. The image below shows this.
The code that I am using for this is:
Public Function buildXAxis(ByVal chartArea As ChartArea, ByVal min As DateTime, ByVal max As DateTime) As Axis
Dim xAxis As New Axis(chartArea, AxisName.X) 'Chart Area is passed into the function
With xAxis
.Interval = 3 'This is the interval, so the next visible label should be 7/1/2013
.IntervalType = DateTimeIntervalType.Months
.IntervalAutoMode = IntervalAutoMode.FixedCount
.Maximum = max.ToOADate 'In this instance, it is 7/29/2013
.Minimum = min.ToOADate 'In this instance, it is 1/29/2013
.TitleAlignment = Drawing.StringAlignment.Center
.TitleForeColor = Drawing.Color.FromArgb(129, 127, 124)
.TextOrientation = TextOrientation.Auto
.LabelAutoFitStyle = LabelAutoFitStyles.LabelsAngleStep45
Dim xLabelStyle As New LabelStyle
xLabelStyle.TruncatedLabels = False
xLabelStyle.IsStaggered = False
xLabelStyle.Format = "d"
.LabelStyle = xLabelStyle
.MajorGrid.LineColor = Drawing.Color.FromArgb(129, 127, 124)
.MinorGrid.LineColor = Drawing.Color.FromArgb(129, 127, 124)
.MajorTickMark.LineColor = Drawing.Color.FromArgb(129, 127, 124)
.MinorTickMark.LineColor = Drawing.Color.FromArgb(129, 127, 124)
End With
Return xAxis
End Function
Does anybody have any idea why those labels are hidden? According to the code, the gridlines are in the right place, (Every 3 months) but the axis labels simply not showing, and this is in fact the only place modifying this code