(Question) Newly added line does not appear immediately.

Oystein Bjorke 4 years ago 0
This discussion was imported from CodePlex

typingcat wrote at 2012-06-27 11:15:

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?


objo wrote at 2012-06-27 15:34:

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!


typingcat wrote at 2012-06-29 08:12:

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. 

CodePlex