fixing y-axis label position
This commit is contained in:
parent
e8de11d590
commit
fc2973067c
1 changed files with 6 additions and 1 deletions
7
yaxis.go
7
yaxis.go
|
@ -195,7 +195,12 @@ func (ya YAxis) Render(r Renderer, canvasBox Box, ra Range, defaults Style, tick
|
|||
tx = canvasBox.Left - (DefaultYAxisMargin + int(sw) + maxTextWidth + DefaultYAxisMargin)
|
||||
}
|
||||
|
||||
ty := canvasBox.Top + (canvasBox.Height()>>1 + tb.Width()>>1)
|
||||
var ty int
|
||||
if nameStyle.TextRotationDegrees == 0 {
|
||||
ty = canvasBox.Top + (canvasBox.Height()>>1 - tb.Width()>>1)
|
||||
} else {
|
||||
ty = canvasBox.Top + (canvasBox.Height()>>1 - tb.Height()>>1)
|
||||
}
|
||||
|
||||
Draw.Text(r, ya.Name, tx, ty, nameStyle)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue