fix: fix the font option of axis
This commit is contained in:
parent
cad8296e28
commit
cf2eb91690
2 changed files with 6 additions and 2 deletions
2
xaxis.go
2
xaxis.go
|
|
@ -68,7 +68,9 @@ func drawXAxis(p *Draw, opt *XAxisOption, yAxisCount int) (int, *Range, error) {
|
||||||
Right: right,
|
Right: right,
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
|
if opt.Font != nil {
|
||||||
dXAxis.Font = opt.Font
|
dXAxis.Font = opt.Font
|
||||||
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, nil, err
|
return 0, nil, err
|
||||||
}
|
}
|
||||||
|
|
|
||||||
2
yaxis.go
2
yaxis.go
|
|
@ -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
|
||||||
}
|
}
|
||||||
|
if opt.Font != nil {
|
||||||
dYAxis.Font = opt.Font
|
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
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue