Class TimeSeries

Index

Constructor methods

Methods

Constructor methods

constructor(options?: ITimeSeriesOptions): TimeSeries

Initialises a new TimeSeries with optional data options.

Options are of the form (defaults shown):

{
  resetBounds: true,        // enables/disables automatic scaling of the y-axis
  resetBoundsInterval: 3000 // the period between scaling calculations, in millis
}

Presentation options for TimeSeries are specified as an argument to SmoothieChart.addTimeSeries.

Parameters

Returns

TimeSeries

Methods

public append(timestamp: number, value: number, sumRepeatedTimeStampValues?: boolean)

Adds a new data point to the TimeSeries, preserving chronological order.

Parameters

  • timestamp: number

    the position, in time, of this data point

  • value: number

    the value of this data point

  • sumRepeatedTimeStampValues?: boolean optional

    if timestamp has an exact match in the series, this flag controls whether it is replaced, or the values summed (defaults to false.)

public dropOldData(oldestValidTime: number, maxDataSetLength: number)

Parameters

  • oldestValidTime: number
  • maxDataSetLength: number

public resetBounds()

Recalculate the min/max values for this TimeSeries object.

This causes the graph to scale itself in the y-axis.