(Question) Newly added line does not appear immediately.

Jun 27, 2012 at 9:15 AM

I have already drawn some lines already,

            plot.Series.Add(line3);
            MyGraph.Model = plot;

and now I want to let users display additional lines by checking on some options.

           MyGraph.Model.Series.Add(optLine);

But the new line does not appear until the graph is redrawn (for example, resizing the window). Calling MyGraph.Model.RefreshPlot() make it appear but then that makes all successive new lines have the same colour. (If I do not use RefreshPlot(), lines have random colours.)

What is the correct way to add new lines dynamically?

Coordinator
Jun 27, 2012 at 1:34 PM

Yes, the plot model is not automatically redrawn. This was a choice I made to keep the code as simple as possible! I think it is also good for performance to have the control when the plot is redrawn.

I checked in a fix for the color bug when series are added at different times. I hope this solves your problem. Thanks for the notice!

Jun 29, 2012 at 6:12 AM

Thank you. I downloaded and built the latest source code, and now the colours looked OK.

The only concern for me is that the binary I am using is no longer a 'stable' version.