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

chart- grouping

1 Answer 22 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Seban
Top achievements
Rank 1
Seban asked on 23 Jan 2014, 09:50 AM
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.

1 Answer, 1 is accepted

Sort by
0
Danail Vasilev
Telerik team
answered on 23 Jan 2014, 12:29 PM
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.
Tags
Chart (Obsolete)
Asked by
Seban
Top achievements
Rank 1
Answers by
Danail Vasilev
Telerik team
Share this question
or