Skip to content

Commit

Permalink
rename: c3: to AddTimeSeriesSet to align with timeseries
Browse files Browse the repository at this point in the history
  • Loading branch information
grokify committed Jun 15, 2021
1 parent 422133d commit 5f6fb86
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/c3/timeseries.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ type TimeseriesPageData struct {
XoxPoints []interval.XoxPoint
}

func (data *TimeseriesData) AddDataSeriesSet(set *interval.TimeSeriesSet, interval tu.Interval, seriesType interval.SeriesType) error {
func (data *TimeseriesData) AddTimeSeriesSet(set *interval.TimeSeriesSet, interval tu.Interval, seriesType interval.SeriesType) error {
data.TimeSeriesSet = set
columns := [][]interface{}{}
xValues := []interface{}{"x"}
Expand Down
5 changes: 5 additions & 0 deletions data/timeseries/time_series.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@ func (ts *TimeSeries) Last() (TimeItem, error) {
return items[len(items)-1], nil
}

// Pop removes the item with the chronologically last
// time. This is useful when generating interval
// charts and the last period has not concluded, thus
// providing an inaccurate projection when compared to
// previous full months of data.
func (ts *TimeSeries) Pop() (TimeItem, error) {
items := ts.ItemsSorted()
if len(items) == 0 {
Expand Down

0 comments on commit 5f6fb86

Please sign in to comment.