Skip to content

refactor Legend system #318

@swharden

Description

@swharden

When it is time for the legend to be drawn, Legend.DrawLegend() iterates through through each plottable and adds one line to the legend (using that plottable's label, line style, and marker shape).

With the emergence of plottables that display grouped data (bar plots and box plots, #315) one plottable may need to display several items in the legend, therefore, how the legend is made needs to be refactored. This issue will track progress toward this goal.

This will probably involve modifying the Plottable class. It currently contains a label property which is used for the legend. It makes more sense to have an ILegendItem (or similar) interface just to contain legend information.

Plottable.cs (before refactoring)

https://github.com/swharden/ScottPlot/blob/08903ac3cef639c86b32a568fc2e0b6988373633/src/ScottPlot/plottables/Plottable.cs#L10-L22

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions