Line chart

On this page 7

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.

ElementWhat it encodesDesign guidance
X-axisOrdered variable such as timeEqual spacing for equal intervals
Y-axisMeasured valueClear unit and readable tick spacing
Line segmentsChange between observationsThick enough to read, thin enough to compare
MarkersActual observationsUse when points are sparse or irregular
Direct labelsSeries identityPrefer over a separate legend
AnnotationsEvents and contextMark launches, outages or policy changes
Visual elements of a line chart

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.

VariantDescriptionBest use
Simple line chartOne series over timeA single KPI trend
Multi-series line chartSeveral lines on shared axesComparing up to about five series
Step line chartHorizontal then vertical segmentsValues that change at discrete moments, such as prices or rates
Indexed line chartEach series rebased to 100Comparing growth of series with different scales
SparklineTiny chart without axesTrend context inside tables or tiles
Area chartLine with filled region belowEmphasizing volume or cumulative totals
Line chart variants

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.

QuestionRecommended chartWhy
How did a value change over timeLine chartContinuous order and slope are visible
How do categories compareBar chartLength on a zero baseline compares well
How are two variables relatedScatter plotShows correlation and clusters
How are values distributedHistogramBins show shape and spread
How does a value vary across two dimensionsHeatmapColor encodes a matrix compactly
Choosing between related chart types

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

MistakeEffect on the readerFix
Lines across categoriesImplies a false continuumUse a bar chart
Uneven time intervals spaced equallyDistorts slopesUse a true time scale
Interpolating across gapsHides missing dataBreak the line at gaps
Too many seriesSpaghetti effectSmall multiples or highlighting
Unlabeled truncated axisExaggerates changeLabel the axis range clearly
Excessive smoothingHides real peaksShow raw data with a trend line
Line chart mistakes and fixes

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.