Skip to content

Add IHasArea interface#1692

Merged
swharden merged 18 commits intoScottPlot:masterfrom
BambOoxX:interface-IHasArea
Feb 23, 2022
Merged

Add IHasArea interface#1692
swharden merged 18 commits intoScottPlot:masterfrom
BambOoxX:interface-IHasArea

Conversation

@BambOoxX
Copy link
Contributor

@BambOoxX BambOoxX commented Feb 20, 2022

This PR implements a IHasArea interface to handle plots that have some sort of Area plotted.
The goal is to implement a common interface for AxisSpan, Pie/Donut ...
Basically the interface comes in addition to IHasColor than only handles a line color or area fill color with

  • BorderColor
  • BorderLineWidth
  • BorderLineStyle
  • HatchColor
  • HatchStyle

Among the benefits, the current way of creating LegendItem for such plots is to define their LineWidth as 10 resulting in the setting of the isRectangle property to true, this new interface allows to draw a specific type of legend item for this kind of plottables.

This allows to update some plots by adding new properties, such as in AxisSpan that serves as a demonstration case for this new interface.

At the moment the other plots that do not implement IHasArea have their legend items broken

Here is a preview of the AxisSpan created using the modified example in 1622529

image

@BambOoxX BambOoxX changed the title Add IHaseArea interface Add IHasArea interface Feb 20, 2022
@BambOoxX BambOoxX mentioned this pull request Feb 20, 2022
@swharden

This comment was marked as resolved.

@swharden swharden enabled auto-merge February 23, 2022 00:24
@swharden swharden merged commit b9e3384 into ScottPlot:master Feb 23, 2022
@BambOoxX
Copy link
Contributor Author

BambOoxX commented Feb 23, 2022

Looks like this change broke legend construction for some plot types 😅

Yeah, it was not yet ready for a merge I believe but that's fine ^^.
I think that the next step for legend rendering is really to react depending on the interface type of each plottable.

@BambOoxX BambOoxX deleted the interface-IHasArea branch February 23, 2022 08:58
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.

2 participants