feat: support bar height for horizontal bar chart

This commit is contained in:
vicanso 2022-09-29 20:20:54 +08:00
parent 0a80e7056f
commit 6652ece0fe
4 changed files with 11 additions and 3 deletions

View file

@ -91,7 +91,7 @@ func (b *barChart) render(result *defaultRenderResult, seriesList SeriesList) (B
if opt.BarWidth > 0 && opt.BarWidth < barWidth {
barWidth = opt.BarWidth
// 重新计算margin
margin = (width - len(seriesList)*barWidth - barMargin*(seriesCount-1)) / 2
margin = (width - seriesCount*barWidth - barMargin*(seriesCount-1)) / 2
}
barMaxHeight := seriesPainter.Height()
theme := opt.Theme