feat: support horizontal bar chart

This commit is contained in:
vicanso 2022-06-15 23:30:37 +08:00
parent b69728dd12
commit 3f24521593
15 changed files with 677 additions and 91 deletions

View file

@ -155,17 +155,17 @@ func (l *legendPainter) Render() (Box, error) {
drawIcon := func(top, left int) int {
if opt.Icon == IconRect {
p.Rect(Box{
Top: top - legendHeight + 4,
Top: top - legendHeight + 8,
Left: left,
Right: left + legendWidth,
Bottom: top - 2,
Bottom: top + 1,
})
} else {
p.LegendLineDot(Box{
Top: top,
Top: top + 1,
Left: left,
Right: left + legendWidth,
Bottom: top + legendHeight,
Bottom: top + legendHeight + 1,
})
}
return left + legendWidth