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

Problem with Dynamically Updating Series

Thread ID:

Created:

Updated:

Platform:

Replies:

49249 Sep 14,2006 09:40 AM UTC Sep 19,2006 06:30 AM UTC WinForms 2
loading
Tags: Chart
Peter
Asked On September 14, 2006 09:40 AM UTC

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

Administrator [Syncfusion]
Replied On 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

Peter
Replied On September 19, 2006 06:30 AM UTC

Hello Jaya,

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

Regards,
Peter

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

;