feat: support install font and enhance title padding

This commit is contained in:
vicanso 2022-02-15 23:38:35 +08:00
parent 11fdd9121a
commit b934b853a9
13 changed files with 268 additions and 65 deletions

View file

@ -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