The chart object returned by Chart, used to write data, update the configuration and clear the chart.
Attributes
Name
Type
Description
add(series, data, index)
function
Writes data to the chart. series is the index of the data series (integer); data is the data to write (array), for example [1574993606000, 13.5]; the optional index selects the data point to modify, negative values allowed, -1 being the last point; without it the data is appended to the series. For example, to modify the last point of series[0]: chart.add(0, [1574993606000, 13.5], -1). In Rust it is add(series, data_json, index) and index is required; a value below 0 appends.
update(options)
function
Replaces the current configuration with a new chart configuration (same as the Chart() argument). Charts without a time axis (for example pie) are updated by passing the whole configuration to update().
reset(remain)
function
Clears the chart data; remain is the number of data points to keep, all are cleared when omitted.
del(series)
function
Deletes the data series at the given index; with an argument of 0 or less, or none, the whole chart (including its configuration) is deleted. In Python the method is named dell() (del is a keyword); Rust has no such method.