fix: fix the font option of axis

This commit is contained in:
vicanso 2022-05-01 11:26:53 +08:00
parent cad8296e28
commit cf2eb91690
2 changed files with 6 additions and 2 deletions

View file

@ -68,7 +68,9 @@ func drawXAxis(p *Draw, opt *XAxisOption, yAxisCount int) (int, *Range, error) {
Right: right, Right: right,
}), }),
) )
dXAxis.Font = opt.Font if opt.Font != nil {
dXAxis.Font = opt.Font
}
if err != nil { if err != nil {
return 0, nil, err return 0, nil, err
} }

View file

@ -96,7 +96,9 @@ func drawYAxis(p *Draw, opt *ChartOption, axisIndex, xAxisHeight int, padding ch
if err != nil { if err != nil {
return nil, err return nil, err
} }
dYAxis.Font = opt.Font if opt.Font != nil {
dYAxis.Font = opt.Font
}
NewAxis(dYAxis, data, style).Render() NewAxis(dYAxis, data, style).Render()
yRange.Size = dYAxis.Box.Height() yRange.Size = dYAxis.Box.Height()
return &yRange, nil return &yRange, nil