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);
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!
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.
{
}
ns = new NumericSeries();
It's a custom event being raised from another part of the code. It is off-thread but I am calling .Invoke(). At one point I was attempting to use a DataTable, which worked fine, but the performance was terrible once there was a bit of data. Maybe 40 or so points and it just bogs down. Would using a Series help that at all or is that typical? My application would go from 1-2% CPU to 50% when the Chart control was in view. Thanks for any guidance on that.
I do not believe there is a built in way to manage how many points are displayed, you would have to know how many points each series has and figure out the scrollscale based on the percentage. .5 for 40 pts .2 for 100 pts and such.
Thanks for all of the help so far. I did have another question. I went back to the DataTable method and made a few changes on how that table is updated (basically slowing it down). My question now is this. I have turned on the ScrollScale so that there is now an horizontal scrollbar. I want it so that that the viewable window is always 20 points wide and at the end of the list. So for instance if there are 30 items in a series, the last 20 are what is in view. I am struggling to get that working. I'm sure I'm missing something. Thanks for any help!
In either case, it would have to recreate the chart to show the new data that is being added. I tested with about 1000 lines and 5 pts per line with both scenarios and using series objects does seem faster, ~0.5 second response time relative to about ~0.8 or so. At 100 lines with 5 pts per line, I could not notice a difference. I guess it depends on how you are implementing the control. How often does your event fire that you are adding additional points? Also, how many charts are you updating at any given time?