test: add test for series
This commit is contained in:
parent
1c89ed29be
commit
51682069d7
7 changed files with 370 additions and 18 deletions
|
|
@ -94,6 +94,7 @@ type Series struct {
|
|||
MarkPoint SeriesMarkPoint
|
||||
MarkLine SeriesMarkLine
|
||||
}
|
||||
type SeriesList []Series
|
||||
|
||||
type PieSeriesOption struct {
|
||||
Radius string
|
||||
|
|
@ -158,6 +159,14 @@ func (s *Series) Summary() seriesSummary {
|
|||
}
|
||||
}
|
||||
|
||||
func (sl SeriesList) Names() []string {
|
||||
names := make([]string, len(sl))
|
||||
for index, s := range sl {
|
||||
names[index] = s.Name
|
||||
}
|
||||
return names
|
||||
}
|
||||
|
||||
type LabelFormatter func(index int, value float64, percent float64) string
|
||||
|
||||
func NewPieLabelFormatter(seriesNames []string, layout string) LabelFormatter {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue