Overview
Line charts are used to visualize data trends over a continuous interval or time period. They’re ideal for showing how values change, making them perfect for time-series data, trend analysis, and comparing multiple datasets.When to Use
Use line charts when you need to:- Show trends or changes over time
- Display continuous data with many data points
- Compare multiple data series on the same axes
- Highlight rates of change and patterns
- Visualize correlations between variables
Basic Configuration
The line chart is configured through theLineSeriesOption interface, which extends the base series options with line-specific properties.
Complete Example
Key Options
The coordinate system to use. Line charts support both Cartesian (2D grid) and polar coordinate systems.
Whether to show as a smooth curve. If set to a number (0-1), it controls the smoothness factor. When
true, defaults to a moderate smoothing.Enable step line style.
'start': Step before the point'end': Step after the point'middle': Step in the middle
Style configuration for the line.
When set, the area under the line will be filled. The
origin property controls where the fill starts.Whether to show symbols (data point markers) on the line.
Controls symbol display strategy:
'auto': Show all symbols if possible, otherwise follow interval strategytrue: Show all symbolsfalse: Follow label interval strategy
Symbol type for data points. Can be:
'circle', 'rect', 'roundRect', 'triangle', 'diamond', 'pin', 'arrow', 'none', or a custom SVG path.Whether to connect null data points. When
false, breaks in the line appear where data is null.When using smooth curves, this ensures monotonicity along the specified axis.
Sampling strategy for large datasets. Options:
'none', 'average', 'max', 'min', 'sum', 'lttb'.Whether to clip overflow values outside the coordinate system.
Label configuration for the end of the line.
Visual emphasis configuration when hovering.
Data Format
Line chart data can be specified in multiple formats:Advanced Features
Area Chart
Create an area chart by adding theareaStyle option:
Step Line Chart
Stacked Line Chart
Source Reference
The line chart implementation can be found in:- Series model:
src/chart/line/LineSeries.ts:137-283 - Default options:
src/chart/line/LineSeries.ts:159-234 - Type definitions:
src/chart/line/LineSeries.ts:56-135