feat: support pie, radar and funnel chart

This commit is contained in:
vicanso 2022-06-16 23:08:20 +08:00
parent 3f24521593
commit 65a1cb11ad
18 changed files with 1987 additions and 85 deletions

View file

@ -92,13 +92,9 @@ func (h *horizontalBarChart) render(result *defaultRenderResult, seriesList Seri
Size: seriesPainter.Width(),
})
for i := range seriesList {
series := seriesList[i]
index := series.index
if index == 0 {
index = i
}
seriesColor := theme.GetSeriesColor(index)
for index := range seriesList {
series := seriesList[index]
seriesColor := theme.GetSeriesColor(series.index)
divideValues := yRange.AutoDivide()
for j, item := range series.Data {
if j >= yRange.divideCount {
@ -108,8 +104,8 @@ func (h *horizontalBarChart) render(result *defaultRenderResult, seriesList Seri
j = yRange.divideCount - j - 1
y := divideValues[j]
y += margin
if i != 0 {
y += i * (barHeight + barMargin)
if index != 0 {
y += index * (barHeight + barMargin)
}
w := int(xRange.getHeight(item.Value))