Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
80
LineChart Error
posted

Hello, I'm trying to just get simple NumericSeries working for a LineChart.

I have tons of other graphs working with NumericTimeSeries, but now I don't want a date in the X-Axis.

I started trying to make a more complicated example, but while trying to get this working, I've resorted to simply trying to graph the following. It's not working, so I need some help. Any comments are appreciated, thank you.

NumericSeries n = new NumericSeries();

n.Points.Add(new NumericDataPoint(1, "1", false));

n.Points.Add(new NumericDataPoint(1, "2", false));

n.Points.Add(new NumericDataPoint(1, "3", false));

n.Points.Add(new NumericDataPoint(1, "4", false));

n.Points.Add(new NumericDataPoint(1, "5", false));

 

ultraChart1.Series.Add(n);

ultraChart1.ChartType = ChartType.LineGraph;

 

ultraChart1.Data.DataBind();

ultraChart1.Update();

 

This produces the following error:

Line Chart Error: You must have at least one row and one numeric column

 

Any ideas why this isn't working?

 

Thank you in advance.

  • 26458
    Offline posted

    My guess is that you have an incompatible or an empty series already defined somewhere in code prior to adding the numeric series, or in the designer. Or you might be setting a DataSource property on the chart, which is not needed when adding series. Try using ultraChart.Series.Clear() before adding the series. Calls to DataBind() and Update() are also not necessary.