Line chart series values

Thread is closed for posting
3 posts, 0 answers
  1. Shalini
    Shalini avatar
    11 posts
    Member since:
    Jun 2008

    Posted 30 Jun 2008 Link to this post

    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. Shalini
    Shalini avatar
    11 posts
    Member since:
    Jun 2008

    Posted 01 Jul 2008 Link to this post

    Please reply ASAP its urgent.
  3. Dwight
    Admin
    Dwight avatar
    475 posts

    Posted 01 Jul 2008 Link to this post

    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
Back to Top