Trends

live example

Explore the API in the live example.

api reference

Component implementing the trends feature. A trends is a labeled pair of dots indicating changes in the plot. When this component is available in a widget, it is accessible through the .trends namespace.
Trends.add(id, key, start, end, label, color[, duration])
Adds a trends to the chart. If the trends ID already exists, no further trends are added.

Parameters

NameTypeDescription
idstringUnique identifier of the trends.
keystringKey of the plot to add the trends to.
startnumberStarting (left side) value of the trends.
endnumberEnding (right side) value of the trends.
labelstringLabel to display on the trends.
colorstringColor of the trend line.
durationnumberoptionalDuration of the animation of adding the trends. Default value is 0.

Returns

Object
The object representing the trends. This object contains the DOM group containing the trends and update/remove methods.
Trends.remove([id[, duration]])
Removes one or all trends from the chart.

Parameters

NameTypeDescription
idstringoptionalIdentifier of the trends to remove. If trends with the specified identifier does not exist, no change is applied. If it is not specified, all trends are removed from the current chart. Default value is undefined.
durationnumberoptionalDuration of the remove animation. Default value is 0.