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

Grouping by month, showing month name

1 Answer 176 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Cheryl
Top achievements
Rank 1
Cheryl asked on 06 Dec 2011, 03:24 AM
Hi, i have a chart which normally has a x axis with a date value.
Under certain circumstances, I'd like to group the results and show the monthly accumulated values, and show the month name

In the data I have both a date field and a month field, and I can easily group by the month field, but I can't seem to format it so that it show the month name rather than the month value.

Can you please point me in the right direction?

This is what I have so far:
Private Sub chart1_ItemDataBinding(ByVal sender As Object, ByVal e As EventArgs) Handles Chart1.ItemDataBinding
 
    Chart1.PlotArea.XAxis.Appearance.LabelAppearance.RotationAngle = -90
 
    If Me.ReportParameters("Time").Value.ToString.Trim = "Daily" Then
        Chart1.PlotArea.XAxis.DataLabelsColumn = "userlogdate"
    ElseIf Me.ReportParameters("Time").Value.ToString.Trim = "Yearly" Then
        Chart1.PlotArea.XAxis.DataLabelsColumn = "year"
        Chart1.DataGroupColumn = "year"
    ElseIf Me.ReportParameters("Time").Value.ToString.Trim = "Monthly" Then
        Chart1.DataGroupColumn = "month"
        Chart1.PlotArea.XAxis.DataLabelsColumn = "month"
        Chart1.PlotArea.XAxis.Appearance.ValueFormat = Charting.Styles.ChartValueFormat.ShortDate
        Chart1.PlotArea.XAxis.Appearance.CustomFormat = ???
 
    End If
 
 
End Sub

Thanks for you help

1 Answer, 1 is accepted

Sort by
0
Nikolay
Telerik team
answered on 08 Dec 2011, 10:33 AM
Hello Cheryl,

PLease, have a look at this help topic. It demonstrates grouping by quarter, however, you could easily substitute it with months.

Hope this helps.

Kind regards,
Nikolay
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Tags
Chart (Obsolete)
Asked by
Cheryl
Top achievements
Rank 1
Answers by
Nikolay
Telerik team
Share this question
or