-
Notifications
You must be signed in to change notification settings - Fork 981
Closed
Description
Problem
After plotting in user controls you have to call Render() to force a redraw.
This is not intuitive to new users and is easy to forget.
double[] dataX = new double[] {1, 2, 3, 4, 5};
double[] dataY = new double[] {1, 4, 9, 16, 25};
formsPlot1.plt.PlotScatter(dataX, dataY);
formsPlot1.Render(); // <-- you must do thisSolution?
Add a delegate to the Plot module:
public delegate void PlottablesUpdated();
public PlottablesUpdated PlottablesUpdatedHandler;Invoke the delegate whenever the list of plottables is modified:
PlottablesUpdatedHandler?.Invoke();User control constructors would wire it together like this:
plt.PlottablesUpdatedHandler = () => Render();Thoughts
- There may be a slight performance hit since adding 5 scatter plots will cause 5 renders
- Automatic rendering can be disabled with
formsPlot1.plt.PlottablesUpdatedHandler = null
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels