feat: support rotate series label

This commit is contained in:
vicanso 2022-11-22 22:41:56 +08:00
parent 55eca7b0b9
commit 4fc250aefc
5 changed files with 66 additions and 12 deletions

View file

@ -560,7 +560,14 @@ func (p *Painter) Text(body string, x, y int) *Painter {
func (p *Painter) TextRotation(body string, x, y int, radians float64) {
p.render.SetTextRotation(radians)
p.render.Text(body, x, y)
p.render.Text(body, x+p.box.Left, y+p.box.Top)
p.render.ClearTextRotation()
}
func (p *Painter) SetTextRotation(radians float64) {
p.render.SetTextRotation(radians)
}
func (p *Painter) ClearTextRotation() {
p.render.ClearTextRotation()
}