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

How to create one series with multiple items

2 Answers 32 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
mahmoud
Top achievements
Rank 1
mahmoud asked on 12 Feb 2014, 09:38 AM
Hello Team,
I want to create one series and bound it to multiple items and with different colors for each item
take a look at my picture this what I select from database Day, Date and Total Time sheet.. My problem now like it seems in the picture
that the bars colors didnt change for each item and series in the the right of the chart just read the first date only.. so please can any one help me how can i achieve this programmatically by C#?

Here's my code:
 RadChart1.PlotArea.XAxis.AutoScale = false;
    RadChart1.PlotArea.XAxis.Items.Clear();
    RadChart1.Series.Clear();
    
    ChartSeries series = new ChartSeries(dt.Rows[0]["doc_date"].ToString(), ChartSeriesType.Bar);
    for (int i = 0; i < dt.Rows.Count; i++)
    {
        //series = new ChartSeries(dt.Rows[i]["doc_date"].ToString(), ChartSeriesType.Bar);
        series.Items.Add(new ChartSeriesItem(Convert.ToDouble(dt.Rows[i]["total_timesheet"])));
        ChartAxisItem axisItem = new ChartAxisItem(dt.Rows[i]["day_name"].ToString());
        RadChart1.PlotArea.XAxis.Items.Add(axisItem);
    }
RadChart1.Series.Add(series);

2 Answers, 1 is accepted

Sort by
0
Danail Vasilev
Telerik team
answered on 13 Feb 2014, 09:18 AM
Hi Mahmoud,

I have already replied to the same question you have asked in this forum thread, so that you can find my answer there.

Could I also ask you to post only one thread per question in future? This will keep the conversation concise and in one place, without duplicating content and efforts.

Thank you for your cooperation.

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 UI for ASP.NET AJAX, subscribe to the blog feed now.
0
mahmoud
Top achievements
Rank 1
answered on 13 Feb 2014, 05:25 PM
Hi Danail Vasilev,
thanks for your reply, and I'm sorry for posting another thread but its just that I need this requirements quickly but admin replies are too late like 6 or 7 days from the date of post.
thanks anyway. you were very helpful.
Tags
Chart (Obsolete)
Asked by
mahmoud
Top achievements
Rank 1
Answers by
Danail Vasilev
Telerik team
mahmoud
Top achievements
Rank 1
Share this question
or