Skip to content

Add Reset() and Reset(Plot plot) methods to IPlotControl#3604

Merged
swharden merged 6 commits intoScottPlot:mainfrom
aniketkumar7:newControlBranch
Apr 6, 2024
Merged

Add Reset() and Reset(Plot plot) methods to IPlotControl#3604
swharden merged 6 commits intoScottPlot:mainfrom
aniketkumar7:newControlBranch

Conversation

@aniketkumar7
Copy link
Contributor

I have added the methods for #3353
This pull request adds two new methods to the IPlotControl interface in the ScottPlot library:

Reset(): Disposes the current plot and creates a new one for the control.
Reset(Plot plot): Loads the given plot into the control.

These new methods provide a consistent way to reset the state of a plot control and load a new plot, regardless of the specific implementation of the control. They are already implemented in the FormsPlot control and can be useful for building controls that need to "wipe the slate clean" and start fresh with a new plot.

Please check it out and merge the pull request

@swharden swharden linked an issue Apr 6, 2024 that may be closed by this pull request
@swharden
Copy link
Member

swharden commented Apr 6, 2024

Looks great @aniketkumar7, thanks so much! I extended the PR to add the required implementation to all the controls, and this will be in the next release 🚀

@swharden swharden linked an issue Apr 6, 2024 that may be closed by this pull request
@swharden swharden merged commit 6c2419f into ScottPlot:main Apr 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

IPlotControl: Add Reset() method

2 participants