fix: fix only one data of pie chart, #12
This commit is contained in:
parent
f483e2a850
commit
c862467a5b
1 changed files with 68 additions and 77 deletions
11
pie_chart.go
11
pie_chart.go
|
|
@ -99,15 +99,7 @@ func (p *pieChart) render(result *defaultRenderResult, seriesList SeriesList) (B
|
||||||
seriesNames = seriesList.Names()
|
seriesNames = seriesList.Names()
|
||||||
}
|
}
|
||||||
theme := opt.Theme
|
theme := opt.Theme
|
||||||
if len(values) == 1 {
|
|
||||||
seriesPainter.OverrideDrawingStyle(Style{
|
|
||||||
StrokeWidth: 1,
|
|
||||||
StrokeColor: theme.GetSeriesColor(0),
|
|
||||||
FillColor: theme.GetSeriesColor(0),
|
|
||||||
})
|
|
||||||
seriesPainter.MoveTo(cx, cy).
|
|
||||||
Circle(radius, cx, cy)
|
|
||||||
} else {
|
|
||||||
currentValue := float64(0)
|
currentValue := float64(0)
|
||||||
prevEndX := 0
|
prevEndX := 0
|
||||||
prevEndY := 0
|
prevEndY := 0
|
||||||
|
|
@ -181,7 +173,6 @@ func (p *pieChart) render(result *defaultRenderResult, seriesList SeriesList) (B
|
||||||
}
|
}
|
||||||
seriesPainter.Text(text, x, y)
|
seriesPainter.Text(text, x, y)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return p.p.box, nil
|
return p.p.box, nil
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue