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

Data unavailability in one series

1 Answer 39 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Avinash
Top achievements
Rank 1
Avinash asked on 17 Dec 2010, 04:04 PM
Hi,

Currently I am adding two series on one chart. As per functionality, I am always showing 6 bars(last 6 months) on it. So there will be always 2 bars for one month becuase of 2 series.

Now due to some reason if there is no data in series 1 and data available for series 2. However, I am not able to show data on first bar even if I have series 2 data.
e.g: If I dont have data for month of december for series 1 and have series 2 data. Graph is not showing december's bar.

So please help me out to resolve this issue or let me know any other workarround.

Thanks,
Avinash

1 Answer, 1 is accepted

Sort by
0
Giuseppe
Telerik team
answered on 22 Dec 2010, 02:02 PM
Hello Avinash,

We were unable to reproduce the problematic behavior in our local tests. Please review the attached code snippet and let us know how to reproduce the erroneous issue:

protected void Page_Load(object sender, EventArgs e)
{
    if (!IsPostBack)
    {
        ChartSeries series = new ChartSeries();
             
        series.Items.Add(new ChartSeriesItem(DateTime.Today.AddMonths(-4).ToOADate(), 50));
        series.Items.Add(new ChartSeriesItem(DateTime.Today.AddMonths(-3).ToOADate(), 40));
        series.Items.Add(new ChartSeriesItem(DateTime.Today.AddMonths(-2).ToOADate(), 60));
        series.Items.Add(new ChartSeriesItem(DateTime.Today.AddMonths(-1).ToOADate(), 90));
        series.Items.Add(new ChartSeriesItem(DateTime.Today.ToOADate(), 10));
 
        RadChart1.Series.Add(series);
 
        ChartSeries series2 = new ChartSeries();
        series2.Items.Add(new ChartSeriesItem(DateTime.Today.AddMonths(-5).ToOADate(), 10));
        series2.Items.Add(new ChartSeriesItem(DateTime.Today.AddMonths(-4).ToOADate(), 20));
        series2.Items.Add(new ChartSeriesItem(DateTime.Today.AddMonths(-3).ToOADate(), 30));
        series2.Items.Add(new ChartSeriesItem(DateTime.Today.AddMonths(-2).ToOADate(), 40));
        series2.Items.Add(new ChartSeriesItem(DateTime.Today.AddMonths(-1).ToOADate(), 50));
        series2.Items.Add(new ChartSeriesItem(DateTime.Today.ToOADate(), 60));
 
        RadChart1.Series.Add(series2);
 
 
        RadChart1.PlotArea.XAxis.IsZeroBased = false;
        RadChart1.PlotArea.XAxis.AddRange(DateTime.Today.AddMonths(-5).ToOADate(), DateTime.Today.ToOADate(), 30);
        RadChart1.PlotArea.XAxis.Appearance.ValueFormat = Telerik.Charting.Styles.ChartValueFormat.ShortDate;
        RadChart1.PlotArea.XAxis.Appearance.LabelAppearance.RotationAngle = 320;
        RadChart1.AutoLayout = true;
    }
}



All the best,
Freddie
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Tags
Chart (Obsolete)
Asked by
Avinash
Top achievements
Rank 1
Answers by
Giuseppe
Telerik team
Share this question
or