|
Draw graph & then update just values |
Posted by pramilav on Apr-12-2010 15:24 |
|
Hi,
We are using Chart Director .NET version. Our need is as follows.
1. For the first time we need 4 graphs to be drawn in a single graph area. ( We have done this successfully using SplineLayer.addDataSet).
2. Our application updates data at runtime and the graphs which were drawn earlier need to be updated as soon as the data changes. We read through the docs provided and could not get enough pointers to achieve this. Can you please suggest a way to get this done ??
Step 1
Graph.addDataSet - called 4 times.
Step 2
Since we have already 4 graphs, we need to modify the drawn graphs according to the latest values. We do not need new data sets.
Thanks,
Pramila. |
Re: Draw graph & then update just values |
Posted by Peter Kwan on Apr-13-2010 00:15 |
|
Hi pramilav,
There is a "Realtime Chart" sample code included in ChartDirector. There is also a "Realtime Chart" section in the ChartDirector documentation. May be you can use them as a reference.
Basically your code structure should be:
Step 1
Create 4 arrays for the 4 data series
Draw the chart using the 4 data series
Step 2
Update the 4 data arrays
Draw the chart using the 4 data series
In the above, "Draw the chart using the 4 data series" is the same for Step 1 and Step 2. So you do not have to write the code twice. You can write the charting code as a function, and calls it in both step 1 and step 2.
Hope this can help.
Regards
Peter Kwan |
|