Skip to content

Axis line position labels should move out of the way instead of overlapping #1972

@hamhub7

Description

@hamhub7

Feature Suggestion

Feature description:
When using multiple axis lines, especially when draggable by the user, their position labels can end up overlapping each other. The suggested feature would be an option that could be turned on in the axis line that would cause its label to move out of the way when overlapping with another axis label.
Code example:

var plt = new ScottPlot.Plot();
plt.AddSignal(DataGen.Sin(51));

var vline1 = plt.AddVerticalLine(23);
vline1.LineWidth = 2;
vline1.PositionLabel = true;
vline1.PositionLabelBackground = vline.Color;
vline1.DragEnabled = true;
vline1.PositionLabelOverlap = false;

var vline2 = plt.AddVerticalLine(24);
vline2.LineWidth = 2;
vline2.PositionLabel = true;
vline2.PositionLabelBackground = vline.Color;
vline2.DragEnabled = true;
vline2.PositionLabelOverlap = false;

The resulting plot would have two labels sitting side-by-side instead of partially overlapped

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