Constructor
Creates a new line series instance.Properties
Color of the line and data points. Defaults to Indigo-600.
Name of the series displayed in the legend.
Whether the series is visible on the chart.
Array of data points to render. Each point has
x and y properties.Downsampled data points actually rendered. Uses LTTB algorithm for datasets over 2000 points.
Scale instance for X-axis coordinate transformation.
Scale instance for Y-axis coordinate transformation.
Whether animations are enabled for this series.
Duration of animations in milliseconds.
Methods
setData
Updates the series data and triggers animation if enabled.Array of data points where each point contains
x and y values.setScales
Sets the X and Y scales for coordinate transformation.Scale instance for X-axis transformation.
Scale instance for Y-axis transformation.
render
Renders the line series on the canvas. Called automatically during the chart render cycle.enableAnimation
Enables animation for the series with an optional custom duration.Animation duration in milliseconds.
disableAnimation
Disables animation for the series.startAnimation
Manually triggers the render animation.getDataAt
Returns the data point closest to the given position, used for tooltips.Position to query, typically mouse coordinates in pixels.
The closest data point within a 10-pixel threshold, or null if none found.
Data format
Line series accepts an array of Point objects:Configuration
When using the Chart API, configure line series through the series config:LineSeriesConfig
Performance
Line series automatically downsamples datasets with more than 2000 points using the LTTB (Largest-Triangle-Three-Buckets) algorithm to maintain visual fidelity while improving rendering performance. This only applies to numeric X values; categorical data is not downsampled.Animation
By default, line series animates on initial render and data updates. The animation:- Uses easeOutCubic easing function
- Progressively draws points from left to right
- Duration is 600ms by default
- Can be customized or disabled