forked from go-echarts/go-echarts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
parallel.go
executable file
路43 lines (36 loc) 路 1.11 KB
/
parallel.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package charts
import (
"github.com/KiVirgil/go-echarts/v2/opts"
"github.com/KiVirgil/go-echarts/v2/render"
"github.com/KiVirgil/go-echarts/v2/types"
)
// Parallel represents a parallel axis.
type Parallel struct {
BaseConfiguration
}
// Type returns the chart type.
func (Parallel) Type() string { return types.ChartParallel }
// NewParallel creates a new parallel instance.
func NewParallel() *Parallel {
c := &Parallel{}
c.initBaseConfiguration()
c.Renderer = render.NewChartRender(c, c.Validate)
c.hasParallel = true
return c
}
// AddSeries adds new data sets.
func (c *Parallel) AddSeries(name string, data []opts.ParallelData, options ...SeriesOpts) *Parallel {
series := SingleSeries{Name: name, Type: types.ChartParallel, Data: data}
series.configureSeriesOpts(options...)
c.MultiSeries = append(c.MultiSeries, series)
return c
}
// SetGlobalOptions sets options for the Parallel instance.
func (c *Parallel) SetGlobalOptions(options ...GlobalOpts) *Parallel {
c.BaseConfiguration.setBaseGlobalOptions(options...)
return c
}
// Validate
func (c *Parallel) Validate() {
c.Assets.Validate(c.AssetsHost)
}