fix: use fixed length for left stroked legend
The stroke length was just way too long, so I first tried to decrease the length by subtracting the padding from it, but it was not a big difference. I ended up using a hardcoded value because it gave the best visual results on different resolutions.
This commit is contained in:
parent
f0b283349e
commit
901d2bb313
1 changed files with 2 additions and 1 deletions
|
@ -145,6 +145,7 @@ func LegendLineLeft(c *Chart, userDefaults ...Style) Renderable {
|
|||
// DEFAULTS
|
||||
lineTextGap := 5
|
||||
lineLengthMinimum := 25
|
||||
strokeLength := 17
|
||||
|
||||
var labels []string
|
||||
var lines []Style
|
||||
|
@ -215,7 +216,7 @@ func LegendLineLeft(c *Chart, userDefaults ...Style) Renderable {
|
|||
ly := ty - th2
|
||||
|
||||
// Calculate line ending x coordinate
|
||||
lx2 := lx + lineLengthMinimum - legendStyle.Padding.Left
|
||||
lx2 := lx + strokeLength
|
||||
|
||||
r.SetStrokeColor(lines[x].GetStrokeColor())
|
||||
r.SetStrokeWidth(lines[x].GetStrokeWidth())
|
||||
|
|
Loading…
Reference in a new issue