Trends
live example
Explore the API in the live example.
api reference
Trends()
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
Name | Type | Description |
---|---|---|
id | string | Unique identifier of the trends. |
key | string | Key of the plot to add the trends to. |
start | number | Starting (left side) value of the trends. |
end | number | Ending (right side) value of the trends. |
label | string | Label to display on the trends. |
color | string | Color of the trend line. |
duration | number | optionalDuration 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
Name | Type | Description |
---|---|---|
id | string | optionalIdentifier 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 . |
duration | number | optionalDuration of the remove animation. Default value is 0 . |