@@ -55,7 +55,7 @@ type SeriesLabel struct {
5555 // Show flag for label
5656 Show bool
5757 // Distance to the host graphic element.
58- Distance int
58+ Distance int // TODO - do we want to replace with just Offset?
5959 // Position defines the label position.
6060 Position string
6161 // Offset specifies an offset from the position.
@@ -85,6 +85,7 @@ type SeriesMarkLine struct {
8585 Data []SeriesMarkData
8686}
8787
88+ // Series references a population of data.
8889type Series struct {
8990 index int
9091 // Type is the type of series, it can be "line", "bar" or "pie". Default value is "line".
@@ -108,6 +109,10 @@ type Series struct {
108109 // Min value of series
109110 Max * float64
110111}
112+
113+ // SeriesList is a list of series to be rendered on the chart, typically constructed using NewSeriesListLine,
114+ // NewSeriesListBar, NewSeriesListHorizontalBar, NewSeriesListPie, NewSeriesListRadar, or NewSeriesListFunnel.
115+ // These Series can be appended to each other if multiple chart types should be rendered to the same axis.
111116type SeriesList []Series
112117
113118func (sl SeriesList ) init () {
@@ -122,7 +127,7 @@ func (sl SeriesList) init() {
122127func (sl SeriesList ) Filter (chartType string ) SeriesList {
123128 arr := make (SeriesList , 0 )
124129 for index , item := range sl {
125- if item .Type == "" || item .Type == chartType {
130+ if item .Type == chartType || ( chartType == ChartTypeLine && item .Type == "" ) {
126131 arr = append (arr , sl [index ])
127132 }
128133 }
@@ -199,7 +204,7 @@ type seriesSummary struct {
199204 AverageValue float64
200205}
201206
202- // Summary get summary of series
207+ // Summary returns numeric summary of series values (population statistics).
203208func (s * Series ) Summary () seriesSummary {
204209 minIndex := - 1
205210 maxIndex := - 1
0 commit comments