lilatracy Posted April 25, 2012 Report Share Posted April 25, 2012 I use Chartfx in an application that shows data from a database. Values are logged into database every few seconds by other software. The chart should be refreshed time after time by pressing a button. How should I do this? When I press the button: - I reset the chart with chart1.reset - I create a new Dataset out of the database and bind it to the Chart with: Chart1.DataSource = ds.Tables(0) . <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /> But chart1.reset isn't the right usage for this, isn't it? Because all chart settings will be lost. If I use only chart1.refresh I get the VisualStudio-Error message: ArgumentOutOfRangeException was unhandled: Specified argument was out of the range of valid values Parameter name: series. What is wrong? Can you explain to me? Quote Link to comment Share on other sites More sharing options...
AndreG Posted April 30, 2012 Report Share Posted April 30, 2012 On the Passing Data sample project, the data of the chart gets cleared every time the data is changed by calling the Clear method on Data. Have you tried that? chart1.Data.Clear(); Quote Link to comment Share on other sites More sharing options...
lilatracy Posted May 4, 2012 Author Report Share Posted May 4, 2012 I tried it and the reaction is: No Data Available in the chart Box. Chart1.Data.Clear(); is the only command when I press my refresh button! Quote Link to comment Share on other sites More sharing options...
AndreG Posted May 4, 2012 Report Share Posted May 4, 2012 You mentioned you wanted to clear the data on the chart, create a new dataset and then bind to it. Are you not binding new data to the chart? If you clear the data and not bind new dataset, you will see the No Data Available message. Quote Link to comment Share on other sites More sharing options...
lilatracy Posted May 4, 2012 Author Report Share Posted May 4, 2012 If I press my refresh button then there will be the following items: Call readDataFromDatabase Chart1.Data.Clear() If Not bDBErr Then Chart1.DataSource = ds.Tables(0) But if I do it like this there will be an Error: ArgumentOutOfRangeException with the following description Specified argument was out of the range of valid values.Parameter name: series So what is wrong? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.