Line series data example with coord and value
Line series data example: data: [[ { coord: [10, 20], value: 10 }, { coord: [20, 30] } ]] shows how to define a line segment with starting position at [10, 20], ending position at [20, 30], and a data value of 10 for the first position.
Line series data structure with coord positions
In line series, each data item is an array where the first element specifies the starting position and the second element specifies the ending position. Each position is assigned via the 'coord' attribute which points to the corresponding coordinate. Each position object contains a 'coord' property with coordinate values and optionally a 'value' property for the data value.
showSymbol option default
The showSymbol property defaults to true. It controls whether to show the symbol at data points. Symbols are shown during tooltip hover.
showAllSymbol option values and behavior
The showAllSymbol property accepts three values: 'auto' (default), true, or false. It only works when the main axis is a category axis. With 'auto', all symbols show if there is enough space, otherwise the interval strategy from axisLabel.interval is followed. With true, all symbols are shown. With false, the interval strategy from axisLabel.interval is followed.
connectNulls option default
The connectNulls property defaults to false. It controls whether to connect the line across null points.
triggerEvent option values and behavior
The triggerEvent property accepts four values: false (default), true, 'line', or 'area'. It controls whether the line or area can trigger events. With false, events are not triggered. With true, both line and area (when using areaStyle) trigger events. With 'line', only the line is the emitter. With 'area', only the area is the emitter (when areaStyle is present). Event parameters include componentType: 'series', componentSubType: 'line', seriesType: 'line', componentIndex: number, seriesIndex: number, seriesName: string, and selfType: 'area' or 'line' to determine if triggered by area or line.
triggerLineEvent deprecated option
The triggerLineEvent property is deprecated as of version 6.1.0 and should be replaced with triggerEvent. It was a boolean option that controlled whether the line and area can trigger events.
step option values
The step property can be set to false (default), true, 'start', 'middle', or 'end'. It controls whether to show the line as a step line and configures the turn point of the step line.
label position default for line series
The default position for labels in line series is 'top'.
endLabel version and description
The endLabel property was added in version 5.0.0. It places a label at the end of the line. It supports formatter and labelMargin options but does not support position.
endLabel valueAnimation option
The endLabel.valueAnimation property is a boolean that controls whether to enable text animation of value change for the end label.
lineStyle default width
The lineStyle property's default width is 2 pixels.
areaStyle default opacity
The areaStyle property's default opacity is 0.7.
smooth option type and behavior
The smooth property can be a boolean or number, defaulting to false. When boolean, it enables or disables smoothing. When a number from 0 to 1, it represents smoothness; a smaller value makes it less smooth. Refer to smoothMonotone to change the smoothing algorithm.
smoothMonotone option description
The smoothMonotone property controls whether a broken line keeps monotonicity when smoothed. It can be set to 'x' or 'y' to keep monotonicity on the x axis or y axis respectively. It is usually used on dual value axis.
sampling option values and behavior
The sampling property controls the downsampling strategy when the data size is much larger than pixel size to improve performance. Options are: 'lttb' (Largest-Triangle-Three-Bucket algorithm to filter points while keeping trends and extremas), 'average' (average value of filter points), 'min' (minimum value), 'max' (maximum value), 'minmax' (maximum extremum absolute value, available since v5.5.0), and 'sum' (sum of filter points). By default it is turned off, meaning all data points are drawn.
Line series coordinate systems
Line series supports three coordinate systems: cartesian2d (default), polar, and singleAxis. It does not support geo.
Line series symbol default
The default symbol for line series is 'emptyCircle' with a default size of 4 pixels.
Data item symbol default for line series
For single data items in line series, the default symbol is 'circle' with a default size of 4 pixels.
Line series type value
The type property for line series is the string 'line'.
Line series animation easing default
The default animation easing for line series is 'linear'.
Line series description
A broken line chart relates all data points by broken lines and is used to show the trend of data changing. It can be used in both rectangular coordinate (grid) and polar coordinate systems. When areaStyle is set, an area chart will be drawn instead. With the visualMap component, line or area charts can have different colors on different sections.