refactor: support echarts options

This commit is contained in:
vicanso 2021-12-16 23:00:31 +08:00
parent 4d8086a283
commit 8f7587561f
7 changed files with 294 additions and 51 deletions

View file

@ -23,6 +23,8 @@
package charts
import (
"strings"
"github.com/wcharczuk/go-chart/v2"
"github.com/wcharczuk/go-chart/v2/drawing"
)
@ -107,3 +109,14 @@ func getSeriesColor(theme string, index int) drawing.Color {
}
return SeriesColorsLight[index%len(SeriesColorsLight)]
}
func parseColor(color string) drawing.Color {
if color == "" {
return drawing.Color{}
}
if strings.HasPrefix(color, "#") {
return drawing.ColorFromHex(color[1:])
}
// TODO
return drawing.Color{}
}