We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

NullReferenceException adding series to Chart

Thread ID:

Created:

Updated:

Platform:

Replies:

72390 Mar 17,2008 01:13 PM UTC Mar 19,2008 09:54 AM UTC ASP.NET Web Forms (Classic) 1
loading
Tags: Chart
David
Asked On March 17, 2008 01:13 PM UTC

Hi,
I am trying to plot a multi-y graph and I am getting a NullReferenceException when I try to add the series to the chart control. The code is very simple:

ChartSeries series;
for(int i=0;i<3;i++)
{
series = this.ChartWebControl1.Model.NewSeries("MultiY" + i.ToString(), ChartSeriesType.Line);

Random autoRand = new Random();
for (int j=0; j<100; j++)
{
series.Points.Add(j, j * autoRand.Next());
}

this.ChartWebControl1.Series.Add(series);
}

I do have a Pie Chart and Bar Chart working just fine with similar setups.

I did notice that while tracing the code I get a "series.BackColor threw an exception of type 'System.IndexOutOfRangeException'"

Thanks.
David.



Administrator [Syncfusion]
Replied On March 19, 2008 09:54 AM UTC

Hi David,

Thank you for your interest in Syncfusion Products.

I am afraid I was unable to reproduce the issue. Please refer the sample in this link
http://websamples.syncfusion.com/samples/Chart.Web/6.1.0.34/72390/main.htm where the code you have given renders Line Chart without throwing an exception.

Can you reproduce the issue in this sample so that we can work in depth and send a better solution?

Regards,
Anupama


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;