Grouping by month, showing month name

Thread is closed for posting
2 posts, 0 answers
  1. Cheryl
    Cheryl avatar
    45 posts
    Member since:
    Jul 2006

    Posted 05 Dec 2011 Link to this post

    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
  2. Nikolay
    Admin
    Nikolay avatar
    385 posts

    Posted 08 Dec 2011 Link to this post

    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top