WIP charts2 parts 2
This commit is contained in:
11 files changed
+271
-10
No files matched your search
+4
-1
@@ -105,7 +105,10 @@ func PieChart(c *ui.Context, slices []ChartSlice, opts PieChartOptions) ChartRes
|
||||
mx, my := internal.Polar(cx, cy, (r0+r1)/2+float32(chartBool(r0 == 0))*r1*0.12, (a0+a1)/2)
|
||||
ink := chartInk(k, keys[i].Color)
|
||||
internal.Marker(p, i, mx, my-8, 9, ink)
|
||||
chartText(p, share(i), mx, my+2, size, ink, 0.5, 0)
|
||||
// The percent shows where the ring is wide enough to hold it.
|
||||
if w, _ := p.MeasureText(0, ui.Span{Text: share(i), Size: size}); r1-r0 >= w+6 {
|
||||
chartText(p, share(i), mx, my+2, size, ink, 0.5, 0)
|
||||
}
|
||||
}
|
||||
}
|
||||
if opts.Donut {
|
||||
|
||||
Reference in new issue
Block a user