Skip to content

Text: Improve background frame alignment and styling options #1417

@riquich

Description

@riquich

Bug Report

Issue: When using background frame for text plots, the alignment rule is not respected for the background frame

Reproducing: Plotting a text with background enabled and alignment is set anything other than Alignment.UpperLeft will reproduce the problem. If I recall correctly this issue was not present in 4.0.*

WpfPlot Root; /*XAML element*/
Text MouseLocationText;
VLine MouseTrackerVertLine;
HLine MouseTrackerHorzLine;
...
...
MouseTrackerVertLine = Root.Plot.AddVerticalLine(DateTime.Now.ToOADate(), color: Color.Red, style: LineStyle.Dash);
MouseTrackerHorzLine = Root.Plot.AddHorizontalLine(4, color: Color.Red, style: LineStyle.Dash);
MouseLocationText = Root.Plot.AddText("", 50, 150, color: Color.Red, size: 18);
MouseLocationText.Alignment = Alignment.UpperRight;
MouseLocationText.BackgroundFill = true;
MouseLocationText.BackgroundColor = Color.Black;

a

System Details

  • ScottPlot Version: 4.1.27
  • Operating System: Windows 10
  • Application Type: WPF
  • .NET Version: .Net core 3.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    BUGunexpected behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions