refactor: enhance chart render function

This commit is contained in:
vicanso 2022-06-17 23:37:21 +08:00
parent 65a1cb11ad
commit 38c4978e44
20 changed files with 665 additions and 462 deletions

View file

@ -36,6 +36,14 @@ type SeriesData struct {
Style Style
}
func NewSeriesListDataFromValues(values [][]float64, chartType ...string) SeriesList {
seriesList := make(SeriesList, len(values))
for index, value := range values {
seriesList[index] = NewSeriesFromValues(value, chartType...)
}
return seriesList
}
func NewSeriesFromValues(values []float64, chartType ...string) Series {
s := Series{
Data: NewSeriesDataFromValues(values),