RadChart Multiple Series with DateTime labels on Xaxis

Thread is closed for posting
2 posts, 0 answers
  1. Prasoon
    Prasoon avatar
    1 posts
    Member since:
    Apr 2013

    Posted 30 Oct 2013 Link to this post

    how it's possible create a chart with multiple line series?

    for example in my db I have:

    Datetime                     Value
    06/10/2011 06:00              8
    06/10/2011 06:10             12
    06/10/2011  06:15            9
    06/10/2011  06:18            6
    06/10/2011   06:21          9

    I want create multiple line series for selected datetime Range where the x-axis is DateTime and the y-axis Value.

    I have tried like this but its not plotting its showing only empty series..
                    series = new ChartSeries();
                        series.Type = ChartSeriesType.Line;
                        series.Name = "RTD"; series.Clear();
                             ChartSeriesItem item = new ChartSeriesItem();

                     item.YValue = Convert.ToDouble(Sqlds.Tables[0].Rows[i][0]);
                    chart1.PlotArea.XAxis[index].TextBlock.Text = DateTime;
                chart1.PlotArea.YAxis.AxisLabel.TextBlock.Text = "DateTime";

                chart1.PlotArea.XAxis.AutoScale = false;
                chart1.PlotArea.XAxis.Appearance.ValueFormat = Telerik.Charting.Styles.ChartValueFormat.LongDate;
                chart1.PlotArea.XAxis.Appearance.CustomFormat = "mm/dd/yyyy hh:mm:ss";
                chart1.PlotArea.XAxis.Appearance.LabelAppearance.RotationAngle = 90;
                //Axis Y
                chart1.PlotArea.YAxis.AxisLabel.TextBlock.Text = "Value";
  2. Stamo Gochev
    Stamo Gochev avatar
    188 posts

    Posted 04 Nov 2013 Link to this post

    Hello Prasoon,

    I prepared a sample page where I use RadChart with two Line series and populate them with some random items.

    If you wan tto know how you can create a chart with more than one series (in general), you can use a "for" loop and create a single series on each iteration and then add it to the chart's Series collection. On the other hand, if you have problems implementing a specific scenario, with multiple Line series, could you explain it to me in short, so I can give you some suggestions? You can also modify my page to show me your case and send it back to me.

    Stamo Gochev
    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.
Back to Top