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

Line chart series values

2 Answers 150 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Shalini
Top achievements
Rank 1
Shalini asked on 30 Jun 2008, 01:33 PM
Hi,

I am facing one issue in line chart, i want to show two lines on chart one is target line and other is progress line.

Target line has two items Starting Sales % and Goal sales %, this line should be strectch from starting date to ending  date.

Progress line will show sales percentage datewise.

X axis - displays date (starting date to ending  date)
Y axis - displays sales percentage ( 0 - 100, steps=10)
Its might possible at some dates sales percentage not available.
for e.g. data is like given below:
Starting Sales % : 35
Goal Sales %: 75

Starting date : 19 June 2008 
Ending date :  26 June 2008 

Date       Sales in %
19 june    45
21 june    55
22 june    60
24 june    60
25 june    65


how can i relate Sales percentage with date i.e it should display 45% for 19 june and 55% for 21 june not for 20 june.In above e.g. sales % is not available for 20 june then first point on progress line should start from 19 june and second point on progress line should be corresponding to 21 June on x-axis.

Please help me on this, i am not getting way to relate my data as per my requirement.

I am using RadChart - Line type version 3.0.2.0.  

2 Answers, 1 is accepted

Sort by
0
Shalini
Top achievements
Rank 1
answered on 01 Jul 2008, 05:30 AM
Please reply ASAP its urgent.
0
Dwight
Telerik team
answered on 01 Jul 2008, 07:58 AM
Hi Shalini,

I suggest setting the X value of each chart item as well:
protected override void OnLoad(EventArgs e) 
    base.OnLoad(e); 
 
    Random r = new Random(42); 
 
    radChart1.PlotArea.XAxis.Appearance.ValueFormat = Telerik.Charting.Styles.ChartValueFormat.LongDate; 
    radChart1.PlotArea.XAxis.Appearance.CustomFormat = "MMMM dd, yyyy"
    radChart1.PlotArea.XAxis.Appearance.LabelAppearance.RotationAngle = -60; 
    radChart1.PlotArea.XAxis.IsZeroBased = false
    radChart1.PlotArea.YAxis.AxisLabel.Visible = true
    radChart1.PlotArea.YAxis.AxisLabel.TextBlock.Text = "Initial text (ABC)"
 
    for (int i = 0; i < 10; i++) 
        this.radChart1.Series[0].AddItem(new ChartSeriesItem(DateTime.Today.AddDays(i).ToOADate(), Math.Round(r.NextDouble() * 100))); 
 
    this.radChart1.Series.Add(new ChartSeries()); 
    this.radChart1.Series[1].Type = ChartSeriesType.Line; 
    this.radChart1.Series[1].AddItem(new ChartSeriesItem(DateTime.Parse("7/01/2008").ToOADate(), 55)); 
    this.radChart1.Series[1].AddItem(new ChartSeriesItem(DateTime.Parse("7/12/2008").ToOADate(), 15)); 

Regards,
Evtim
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Chart (Obsolete)
Asked by
Shalini
Top achievements
Rank 1
Answers by
Shalini
Top achievements
Rank 1
Dwight
Telerik team
Share this question
or