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

Two series with different number of values.

3 Answers 31 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Sonia
Top achievements
Rank 1
Sonia asked on 19 Apr 2013, 11:03 AM
I want to use RadChart to show the evolution of an indicator value compared to an objective value along a configurable period.

A database query returns the list of values, however maybe there is no values for all the periods.

01/01/2013 47,32
01/02/2013 35,36
01/03/2013 60,53
01/04/2013 82,75

I made the DataBind from a SqlDataReader.

On the other hand i know the objective value at the begining of the period and at the end of the period, for example:

01/01/2013
20           //This is the objective value in the first period
01/12/2013 120 //This is the objective value in the last period


ChartSeries serieObjective = new ChartSeries("Objective") { Type = ChartSeriesType.Line };
serieObjective.Items.Add(new ChartSeriesItem(1, 20));

int
periods = NumberOfPeriods(firstPeriod, lastPeriod);  //Returns the number of periods (in this example 12)
serieObjective.Items.Add(new ChartSeriesItem(periods, 120));
chart.Series.Add(serieObjective);

In my chart I only can see the first 4 periods as the first serie only has 4 values.
Therefore I cannot see the value of the second serie at the end of the period.

Any suggestion.
Thank you in advance.

3 Answers, 1 is accepted

Sort by
0
Sonia
Top achievements
Rank 1
answered on 23 Apr 2013, 12:22 PM
Please help.
Anybody knows how to achieve that?

0
Accepted
Tsvetie
Telerik team
answered on 24 Apr 2013, 10:29 AM
Hello Sonia,

I am not quite sure I understand your scenario completely. That is why, in case the information below does not help you, please open a new support ticket and send me a simple running project, demonstrating the problem that you have.

I created a simple test page to test your scenario but I was unable to reproduce the problem with the second line series not being fully visible. Here is the code of my test page for your reference:

<telerik:RadChart ID="RadChart1" runat="server">
</telerik:RadChart>

ChartSeries serieIndicator = new ChartSeries("Indicator") { Type = ChartSeriesType.Line };
 
serieIndicator.Items.Add(new ChartSeriesItem(1, 47));
serieIndicator.Items.Add(new ChartSeriesItem(2, 35));
serieIndicator.Items.Add(new ChartSeriesItem(3, 60));
serieIndicator.Items.Add(new ChartSeriesItem(4, 82));
RadChart1.Series.Add(serieIndicator);
 
ChartSeries serieObjective = new ChartSeries("Objective") { Type = ChartSeriesType.Line };
 
serieObjective.Items.Add(new ChartSeriesItem(1, 20));
serieObjective.Items.Add(new ChartSeriesItem(12, 120));
RadChart1.Series.Add(serieObjective);

You can review our online demos and documentation for additional information on RadChart for ASP.NET
AJAX.

All the best,
Tsvetie
the Telerik team
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 their blog feed now.
0
Sonia
Top achievements
Rank 1
answered on 26 Apr 2013, 08:15 AM
Thank you Tsvetie. Your sample has helped me to find the problem.
Tags
Chart (Obsolete)
Asked by
Sonia
Top achievements
Rank 1
Answers by
Sonia
Top achievements
Rank 1
Tsvetie
Telerik team
Share this question
or