Open hypolas opened 2 weeks ago
Hello,
I try to set color to pie chart serie.
In my case, I need, for exemple, to set color "red" (for error data) and green (for valide data) .
That seems don't work. I try with:
p, err := charts.PieRender( values, charts.TitleOptionFunc(charts.TitleOption{ Text: "Rainfall vs Evaporation", Subtext: "Fake Data", Left: charts.PositionCenter, }), charts.PaddingOptionFunc(charts.Box{ Top: 20, Right: 20, Bottom: 10, Left: 20, }), charts.LegendOptionFunc(charts.LegendOption{ Orient: charts.OrientVertical, Data: []string{ "tests", "failures", "errors", }, Left: charts.PositionLeft, }), charts.PieSeriesShowLabel(), func(opt *charts.ChartOption) { opt.SeriesList[1].Style.FillColor = drawing.ColorRed opt.SeriesList[2].Style.FillColor = drawing.ColorRed }, )
I'll fix it later.
This can be temporarily solved by specifying a theme color, https://github.com/vicanso/go-charts/blob/main/theme.go#L124
Hello,
I try to set color to pie chart serie.
In my case, I need, for exemple, to set color "red" (for error data) and green (for valide data) .
That seems don't work. I try with: