Skip to content

VerticalLine and HorizontalLine Label background color does not change as setting #3309

@PhoenixChenLu

Description

@PhoenixChenLu

Issue:
the vLine and hLine label background color would always be the same as linestyle color, nomatter what color set in label background property.
ScottPlot Version: 5.0.20 WPF version

Code Sample: See http://scottplot.net/faq/repro/ for tips about creating reproducible code samples

ScottPlot.Plot myPlot = new();
myPlot.Style.Background(Colors.Black, Colors.Black);
myPlot.Style.ColorLegend(Colors.Black, Colors.White, Colors.White);
myPlot.Style.ColorAxes(new Color(255, 255, 255, 64));
myPlot.Style.ColorGrids(Colors.White);
			
myPlot.Axes.Bottom.IsVisible = true;
myPlot.Axes.Top.IsVisible = false;

myPlot.Axes.Left.IsVisible = true;
myPlot.Axes.Right.IsVisible = false;

myPlot.Axes.Left.TickLabelStyle.FontSize = 48;
myPlot.Axes.Left.MaximumSize = 100;
myPlot.Axes.Left.MinimumSize = 100;

myPlot.Axes.Right.IsVisible = false;

myPlot.Axes.SetLimits(0, 86400, 0, 10000);
			
VerticalLine vLine = myPlot.Add.VerticalLine(43200);
HorizontalLine hLine = myPlot.Add.HorizontalLine(5000);
hLine.IsVisible = true;
hLine.Label.FontSize = 36;
hLine.Label.IsVisible = true;
hLine.Label.Text = "5000";
hLine.LineStyle.Color = Colors.White;
hLine.Label.BackColor = Colors.Black;
			

vLine.Label.IsVisible = true;
vLine.Label.Text = "12:00";
			
myPlot.Refresh();
myPlot.SavePng("bug.png");

the horizontal line color should be white and its label background should be black, but label background is actually white

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