refactor: support echarts options
This commit is contained in:
parent
4d8086a283
commit
8f7587561f
7 changed files with 294 additions and 51 deletions
13
theme.go
13
theme.go
|
|
@ -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{}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue