Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET > Chart > How to set month name in X-axis of StackBar Chart
RadControls for ASP.NET are no longer supported (see this page for reference). In case you have inquiries about the Telerik ASP.NET AJAX controls, post them in the pertinent ASP.NET AJAX forums.

Not answered How to set month name in X-axis of StackBar Chart

Feed from this thread
  • annu avatar

    Posted on May 13, 2011 (permalink)

    I want to display the month name in x-axis of StackBar Chart. I am setting the XAxis value by the following code:

            RadChart1.PlotArea.XAxis.MinValue = 1;
            RadChart1.PlotArea.XAxis.MaxValue = 12;
            RadChart1.PlotArea.XAxis.LabelStep = 1;

    Currently it is displaying the value in x-axis from 1 to 12, in that place I want to display the month name.
    Internally I want the month number as my chart is displaying based on the Month Number. My chart is displaying the total Meter Consumption of MeterId 100,101,111222333 on Month 4 and 5.

    But for displaying purpose I want to display the month name.
    I am attaching the screen shots.
    Attached files

  • Tsvetie Tsvetie admin's avatar

    Posted on May 18, 2011 (permalink)

    Hello annu,
    Basically, in this case, you should set the x-axis labels manually. Please refer to our online documentation for additional information on this topic and code samples:

    All the best,
    Tsvetie
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

  • annu avatar

    Posted on May 18, 2011 (permalink)

    Thanx for reply. It is working properly if we set the static data in XAxis like from 1 to 12 then it displays the month name as Jan,Feb..
    But based upon the range of the date I have to display the month in XAxis.
    For ex-  From Date-10/01/2010  and To Date- 05/02/2011
    then in the XAxis the month should displays as Oct,Nov,Dec,Jan,Feb,Mar,Apr and May

    and if From Date-01/01/2011  and To Date- 03/02/2011
    then in the XAxis the month should displays as Jan,Feb,Mar.

    So, dynamically I need to set the month in XAxis.
    I am retrieving the data from the database in number format as shown below:
                      MonthName         Consumption
                             1                       1200
                             2                          500
                             3                         1500
                             ..                          ...
                             12                         540
    So, in XAxis I have to display MonthName and in Y-Axis the Consumption and based upon the range of date (as mentioned above).
    Please help me out.

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET > Chart > How to set month name in X-axis of StackBar Chart