refactor: adjust label padding of axis
This commit is contained in:
parent
0a3ac7096a
commit
c220b10ae6
4 changed files with 5 additions and 4 deletions
3
axis.go
3
axis.go
|
|
@ -154,7 +154,8 @@ func (a *axisPainter) Render() (Box, error) {
|
|||
|
||||
textMaxWidth, textMaxHeight := top.MeasureTextMaxWidthHeight(data)
|
||||
|
||||
textFillWidth := float64(textMaxWidth) * 1.3
|
||||
// 增加30px来计算文本展示区域
|
||||
textFillWidth := float64(textMaxWidth + 20)
|
||||
textCount := ceilFloatToInt(float64(top.Width()) / textFillWidth)
|
||||
unit := ceilFloatToInt(float64(dataCount) / float64(chart.MaxInt(textCount, opt.SplitNumber)))
|
||||
// 偶数
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue