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
210
LineChart with series help
posted

Ok, I am starting to get frustrated here. Not sure what I am doing wrong. I have a UltraChart set to LineChart. I create a NumericSeries and call UltraChart.Series.Add(mySeries). Every time a certain event is fired I add a NumericDataPoint to mySeries. For some reason, it never graphs anything. What am I missing? The code is below:

mySeries = new NumericSeries();mySeries.Visible = true;

mySeries.Label = _watch[0].CarNumber;

watchRunChart.Series.Add(mySeries);

In the event:

mySeries.Points.Add( new NumericDataPoint(Math.Round(lap.LapTime.TotalSeconds), tod.ToString(), false));

I am sure I am missing something simple! Any help would be much appreciated. By the way this is v7.3 and ultimately I will need to add 6 seperate series to this chart. Is that possible? Thanks!

Parents
  • 10880
    posted

    In what event are you adding the new points?

    I tried the following in button click and had no issues.  You may run into issues if you are trying to do the same not on the UI thread.  Also, I did this in 8.2 but it should be the same in 7.3.

    private void button1_Click(object sender, EventArgs e)

    {

    for (int x = 0; x < 5; x++)

    {

    ((
    NumericSeries)this.ultraChart1.Series[x]).Points.Add(new NumericDataPoint(System.DateTime.Now.Second-x, x.ToString(), false));

    }

    }

    private void Form1_Load(object sender, EventArgs e)

    {

    NumericSeries ns;for(int x =0;x<5;x++)

    {

    ns = new NumericSeries();

    this.ultraChart1.Series.Add(ns);

    }

     

    }

Reply Children