chart- grouping

Thread is closed for posting
2 posts, 0 answers
  1. Seban
    Seban avatar
    14 posts
    Member since:
    Jun 2012

    Posted 23 Jan 2014 Link to this post

    Sir,
    I have a radchart,

    in y  axis display the values and x axix display the period 9ex. jan-jun,july-desc)
    i am following the grouping example of chart control emo, but i cannot working correctly. Please provide simple example of grouping of bar chart  . very urgent

    Thanks,
    by,

    Seban.
  2. Danail Vasilev
    Admin
    Danail Vasilev avatar
    1494 posts

    Posted 23 Jan 2014 Link to this post

    Hi Seban,

    Please find an example of RadChart's grouping functionality below:
    ASPX:
    <telerik:RadChart ID="RadChart1" runat="server" DefaultType="Bar"></telerik:RadChart>
    C#:
    protected void Page_Load(object sender, EventArgs e)
    {
     
        RadChart1.DataGroupColumn = "Year";
        RadChart1.PlotArea.XAxis.DataLabelsColumn = "Quarter";
        RadChart1.Legend.Appearance.GroupNameFormat = "#NAME:#VALUE";
        RadChart1.DataSource = GetData();
        RadChart1.DataBind();
    }
     
    protected DataTable GetData()
    {
        DataTable dt = new DataTable();
        dt.Columns.Add("Year");
        dt.Columns.Add("Quarter");
        dt.Columns.Add("Value");
        dt.Rows.Add(2007, "Q1", 01);
        dt.Rows.Add(2007, "Q2", 05);
        dt.Rows.Add(2007, "Q3", 08);
        dt.Rows.Add(2007, "Q4", 09);
        dt.Rows.Add(2008, "Q1", 11);
        dt.Rows.Add(2008, "Q2", 15);
        dt.Rows.Add(2008, "Q3", 18);
        dt.Rows.Add(2008, "Q4", 19);
        return dt;
    }


    Regards,
    Danail Vasilev
    Telerik
    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 the blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top