Legend: detach and toggle visibility of plottables (WinForms)#1589
Legend: detach and toggle visibility of plottables (WinForms)#1589swharden merged 33 commits intoScottPlot:masterfrom
Conversation
…s of labels with a scrollable panel
…ded `Legend` property - `Plot` alone does not have a `Refresh` method
…ed legend picture
- If a plottable is set to invisible using the detached legend, it remains plotted in the detached legend, but with a dimming overlay to reflect the sattus change - Requires access to visibility status of the plottables. Example of modification with `Scatter` by adding `plottableVisible` property to `LegendItem` - `UpdateLegendItems` can optionally show all plots whether they have a label or not (probably not very stable at the moment)
|
@swharden Did you manage to get a quick look to the |
Hi @BambOoxX! I hadn't looked at it until now - I've been totally lost in spline land this weekend #1577 #1593 🤪 I edited your original comment to include a demonstration of what this PR does. It's looking great! I'll do a line-by-line review now and offer suggestions if I see any.
|
swharden
left a comment
There was a problem hiding this comment.
This is looking great @BambOoxX! I added more comments than some of your other PRs because there are so many changed files here (I don't want you to think I'm being overly critical)
Let me know if you have any questions about any of these! If you go through and resolve these points best you can I'd be happy to pick it up from there and we can merge it in soon 👍🚀
- `includeall` replaced with `includeInvisibleOrEmptyLabels` - Added a help section to describe the optionalbehavior
|
@swharden Could you tell me if you see something you don't want to be modified. I really don't want to ruin something here ^^ |
|
Hi @BambOoxX, thanks again for all this work! It took me a while to get back to you because my work on #1606 / #1593 took more time than I expected 😅 I'll start to review it now and make some commits to this PR branch then merge it in hopefully later tonight (I'm in EST time zone). I recommend that you not make changes or push commits to this PR branch while I'm actively working on it to avoid merge conflicts. Thanks for resolving so many of those issues! I'll do my best to resolve the remaining open issues myself and get this merged. After this gets merged we can still improve this system at any time with new PRs 👍 |
|
oh, and thanks again for your work on #1422 - it's what inspired me to go back and work on spline interpolation! Those draggable points are awesome |
This prevents GetLegendBitmap() from crashing in cases where the legend was never explicitly enabled
previously only legends with white backgrounds were supported
true -> show legend false -> hide legend null -> do not change legend visibility in all cases return the Legend
fixes bug where number of plottables is different than number of items appearing in the legend (e.g., single pie plots with many labels in the legend)
|
Wow, that was complicated! Lots of sticky little edge cases with this one. I think I got all of them worked-out, but if you have ideas for improvements feel free to open a new PR. Thanks again for all your excellent work on this @BambOoxX! 🚀 |
That looks reaaaaaaaally nice ! |
|
@swharden You did an awesome job improving my proposal, I couldn't have brought it so far ! Well done ! |

This PR is a WIP, it implements some ideas about interactive legends discussed in #1573 for WinForms :