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

@ -50,6 +50,7 @@ type LegendOption struct {
Orient string
}
// NewLegendOption creates a new legend option by legend text list
func NewLegendOption(data []string, position ...string) LegendOption {
opt := LegendOption{
Data: data,
@ -101,6 +102,8 @@ func (l *legend) Render() (chart.Box, error) {
legendDotHeight := 5
textPadding := 5
legendMargin := 10
// 往下移2倍dot的高度
y += 2 * legendDotHeight
widthCount := 0
maxTextWidth := 0