fix: fix pie chart legend
This commit is contained in:
parent
b5b2d37e87
commit
3af0d4d445
3 changed files with 8 additions and 3 deletions
File diff suppressed because one or more lines are too long
|
|
@ -136,9 +136,14 @@ func defaultRender(p *Painter, opt defaultRenderOption) (*defaultRenderResult, e
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
top := chart.MaxInt(legendHeight, titleBox.Height())
|
||||||
|
// 如果是垂直方式,则不计算legend高度
|
||||||
|
if opt.LegendOption.Orient == OrientVertical {
|
||||||
|
top = titleBox.Height()
|
||||||
|
}
|
||||||
p = p.Child(PainterPaddingOption(Box{
|
p = p.Child(PainterPaddingOption(Box{
|
||||||
// 标题下留白
|
// 标题下留白
|
||||||
Top: chart.MaxInt(legendHeight, titleBox.Height()) + 20,
|
Top: top + 20,
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue