Line Chart

A line chart is a statistical chart composed of points and lines in a Cartesian coordinate system, commonly used to represent changes in values over continuous time intervals or ordered categories. In a line chart, the x-axis is typically used for continuous time intervals or ordered categories, while the y-axis is used for quantitative data — negative values are plotted below the x-axis. Lines connect adjacent data points. Line charts are used to analyze trends of things changing over time or ordered categories. Data-wise, a line chart requires a continuous time field or a categorical field and at least one continuous data field.

Use Cases

  • Changes in the same variable over time or ordered categories, such as the trend of Apple computer sales as a proportion of Apple profit from 2000 to 2016

Visual Examples

Global Average Temperature Anomaly

Monthly Average Temperature Comparison of Four Cities, Custom Colors

Global Renewable Energy Installed Capacity Trend, Custom Palette

Options

Configuration Options

PropertyTypeRequiredDescription
typestringrequiredValue must be "line".
dataObject[]requiredChart data.
data.timestring | numberrequiredTime series name.
data.valuenumberrequiredData value.
data.groupstringoptionalGroup name.
titlestringoptionalChart title.
axisXTitlestringoptionalX-axis title.
axisYTitlestringoptionalY-axis title.
theme'default' | 'dark' | 'academy'optionalChart theme, default is "default".
styleObjectoptionalChart style.
style.backgroundColorstringoptionalMust be a valid color value.
style.palettestring[]optionalMust be an array of valid color values.
style.lineWidthnumberoptionalValue must be greater than 0.