A line chart is a chart that plots values as points along an ordered horizontal axis, usually time, and connects consecutive points with straight line segments. In data visualization, it is the standard form for showing trends, seasonality, rates of change and turning points in continuous series.
The connecting line is not decoration. It tells the reader that the values between observations are meaningful and continuous, which is why a line chart suits monthly revenue or hourly temperature but is the wrong choice for unordered categories such as countries or product names.
How a line chart encodes data
A line chart uses position on two axes as its main visual encoding. The x-axis carries the ordered variable, the y-axis carries the measured quantity, and the slope of each segment shows the direction and speed of change between neighboring points.
Because humans judge position along a common scale very accurately, line charts support precise reading of individual values and comparisons across series. Multiple series share the same axes and are distinguished by color, line style or direct labels at the end of each line.
| Element | What it encodes | Design guidance |
|---|---|---|
| X-axis | Ordered variable such as time | Equal spacing for equal intervals |
| Y-axis | Measured value | Clear unit and readable tick spacing |
| Line segments | Change between observations | Thick enough to read, thin enough to compare |
| Markers | Actual observations | Use when points are sparse or irregular |
| Direct labels | Series identity | Prefer over a separate legend |
| Annotations | Events and context | Mark launches, outages or policy changes |
Variants of the line chart
Several variants adapt the basic form to particular data. Choosing the right one depends on how the measured process actually behaves between observations and on how many series must be shown.
| Variant | Description | Best use |
|---|---|---|
| Simple line chart | One series over time | A single KPI trend |
| Multi-series line chart | Several lines on shared axes | Comparing up to about five series |
| Step line chart | Horizontal then vertical segments | Values that change at discrete moments, such as prices or rates |
| Indexed line chart | Each series rebased to 100 | Comparing growth of series with different scales |
| Sparkline | Tiny chart without axes | Trend context inside tables or tiles |
| Area chart | Line with filled region below | Emphasizing volume or cumulative totals |
When more than about five to seven series compete for attention, the chart becomes a tangle. Small multiples, a grid of small charts with identical axes, or highlighting one series while graying out the rest usually communicate better.
Line charts compared with other chart types
The line chart belongs to a family of basic visualization forms, each answering a different question. Picking the form by question rather than by habit prevents most charting errors.
| Question | Recommended chart | Why |
|---|---|---|
| How did a value change over time | Line chart | Continuous order and slope are visible |
| How do categories compare | Bar chart | Length on a zero baseline compares well |
| How are two variables related | Scatter plot | Shows correlation and clusters |
| How are values distributed | Histogram | Bins show shape and spread |
| How does a value vary across two dimensions | Heatmap | Color encodes a matrix compactly |
A line chart and a bar chart can show the same monthly totals. The bar chart emphasizes individual amounts, while the line chart emphasizes the trajectory. For long series of dozens or hundreds of periods, the line chart remains readable where bars become crowded.
Axis scaling and design choices
Unlike a bar chart, a line chart does not require a zero baseline, because it encodes values by position rather than length. Truncating the y-axis is legitimate when the goal is to show variation, but the axis must be clearly labeled so that small changes are not mistaken for large ones.
A logarithmic y-axis is appropriate when values span several orders of magnitude or when the interest lies in growth rates, because equal slopes then represent equal percentage changes. Dual y-axes should be used sparingly, since the apparent relationship between two lines depends entirely on the arbitrary scaling of each axis.
The aspect ratio also shapes perception. A common guideline, banking to 45 degrees, sizes the chart so that the average slope of segments is close to 45 degrees, making changes neither exaggerated nor flattened.
Common mistakes with line charts
| Mistake | Effect on the reader | Fix |
|---|---|---|
| Lines across categories | Implies a false continuum | Use a bar chart |
| Uneven time intervals spaced equally | Distorts slopes | Use a true time scale |
| Interpolating across gaps | Hides missing data | Break the line at gaps |
| Too many series | Spaghetti effect | Small multiples or highlighting |
| Unlabeled truncated axis | Exaggerates change | Label the axis range clearly |
| Excessive smoothing | Hides real peaks | Show raw data with a trend line |
Explained without jargon
A line chart is a picture of how something changes. Each dot marks a value at a certain moment, for example the temperature at each hour of the day, and a line joins the dots from left to right.
Following the line with the eye shows at once whether things are rising, falling or staying flat, and how fast. It works like the trace on a heart monitor: the exact numbers matter, but the shape of the line tells the story first.
A typical use case
An operations team at an online service monitors the daily count of failed logins over the past 90 days. A line chart on the team dashboard shows a stable level of about 1,200 failures per day with a regular weekly pattern, lower on weekends.
On day 74 the line jumps to more than 9,000 and stays high. Because the chart includes an annotation for a password policy change deployed that morning, the team links the spike to the change within minutes rather than suspecting an attack. A second line for successful logins, plotted on the same scale, confirms that real users are affected.
The team reverts the policy, and the failed-login line returns to its usual level the next day. The chart then serves as clear evidence in the incident review, showing both the cause and the recovery at a glance.