feat: support install font and enhance title padding
This commit is contained in:
parent
11fdd9121a
commit
b934b853a9
13 changed files with 268 additions and 65 deletions
3
title.go
3
title.go
|
|
@ -142,7 +142,8 @@ func drawTitle(p *Draw, opt *TitleOption) (chart.Box, error) {
|
|||
for _, item := range measureOptions {
|
||||
item.style.WriteTextOptionsToRenderer(r)
|
||||
x := titleX + (textMaxWidth-item.width)>>1
|
||||
d.text(item.text, x, titleY)
|
||||
y := titleY + item.height
|
||||
d.text(item.text, x, y)
|
||||
titleY += item.height
|
||||
}
|
||||
height := titleY + padding.Top + padding.Bottom
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue