Problem with Dynamically Updating Series

I''m trying to dynamically update data on a graph: a user selects from a dropdown and I display the series. The very first time it works, i.e. there is no data on the graph. Every other time thereafter it doesn''t.

Here''s some code I used that beginning and end of the function:
Debug.Write(vbTab & "Series.Count: ")
Debug.WriteLine(ChartControl1.Model.Series.Count)
Debug.Write(vbTab & "Points(0): ")
Debug.WriteLine(ChartControl1.Model.Series(0).Points.Count)

The first time it runs I get:
Series.Count: 1
Points(0): 7
And the end of the function I get:
Series.Count: 1
Points(0): 111
So that''s right. I presume the 7 points are the default design data, and my data has 111 point. The data displays correctly.

*But*, When I call the function again, I get at the beginning:
Series.Count: 1
Points(0): 7
And the graph is cleared of all data. In fact, when the statement:
ChartControl1.Model.Series.Count
is called, then the graph is cleared.

When I make further changes, no further changes are displayed, e.g. when I change the axis range, the range values are different in my code as they on the screen, e.g. the axis is showing 0-100 on the screen and examining the values in the immediate window will show 100-200.

It seems the graph on the form is becoming disconnected because of implicit object creation somewhere.

If someone could show me the recommended way to display a series, then update (or replace) the series with a different set of values, i.e. The goal is the _appearance_ of a dynamically updating graph.

Many thanks in advance.
Peter

2 Replies

AD Administrator Syncfusion Team September 18, 2006 07:02 AM UTC


Hi Peter,

Sorry for the delay in updating you.

I was not able to reproduce the mentioned issue.

It is possible to update the series dynamically.

Please try the attached sample which helps you to update the existing points and to add the new points dynamically.

You need to set the AxisRangeType to Set to display the correct Range on the screen.

The following code illustrate this :

this.chartControl1.PrimaryXAxis.RangeType=ChartAxisRangeType.Set;
this.chartControl1.PrimaryXAxis.Range.Min=0;
this.chartControl1.PrimaryXAxis.Range.Max=10;
this.chartControl1.PrimaryXAxis.Range.Interval=1;

Kindly let me know if this helps.

Thank you for choosing Syncfusion products.

Regards,
Jaya

dynamicChart.zip


PE Peter September 19, 2006 06:30 AM UTC

Hello Jaya,

Many thanks for your reply. It''s now working!

Regards,
Peter

Loader.
Up arrow icon