Charts

Line Chart

The easiest way to reveal trends and changes over time.

What is a line chart?

A line chart is designed to display information as a series of data points connected by straight line segments, making it excellent at showcasing trends in data over time. Typically, the x-axis represents the independent variable (often time), while the y-axis or dependent variable represents the values being measured. The individual data points are plotted on the graph, and the lines between them illustrate the progression or relationship between the variables.

This type of chart is particularly effective for identifying patterns, comparing datasets, and understanding growth or decline over time.

Line charts are versatile and can reveal trends with just a glance. This makes them one of the most popular and adaptable forms of data visualization.

Default line chart
A line chart that fully supports error visualization
Line chart showing the progression of two groups over time, with visual bands around each line representing their error margins.

First-class support for error visualization

It's important to provide an accurate image of the data by displaying any uncertainty. That's why Graphmatik line charts automatically calculate necessary summary statistics and support error visualization by default.

Graphmatik lets you customize your error visuals allowing you to plot area fills or error bars.

A line chart that visualizes error as area fills.A line chart that shows error margins as error bars.

Y-axis: To cut or NOT to cut?

Cutting the y-axis, means setting the lower bound of the y-axis above zero. To say this is "SPICY drama" in the data vizualization community would be an understatement.

The argument against, rightly points out, that cutting the axis can exaggerate differences and potentially mislead viewers into perceiving larger changes than actually exist. While the argument for suggest time-series (line charts) are specifically designed to show trends and variations relative to a baseline and NOT absolute changes with respect to zero.

The concensus can best be summarized by Edward Tufte, an expert in data visualization.

“In general, in a time-series, use a baseline that shows the data not the zero point..." - Edward Tufte

Graphmatik's default behaviour is to cut the axis. Whether starting the y-axis at zero is appropriate for your data depends on the specific context of the data.

Line chart showing data over time. The y-axis starts at zero, which visually flattens the changes in the data.
Line chart showing data over time. The y-axis starts at the data's baseline and shows an upward trend overtime.
CAUTION: While cutting the axis of line charts is acceptable, it's bad practice for many other chart types, like bar charts, where the axis should always start at zero to accurately compare absolute differences.

Tips for creating beautiful line and area charts

Filtering
Leverage filters to highlight specific categories and make them instantly stand out.
Multi-series line chart showing various trends over time. One specific trend is highlighted in purple, with all other trends grayed out for comparison.
Uh-oh, Spaghetti-O
A "spaghetti plot" is a line chart with too many lines, making it hard to read. Aim for fewer than 5 lines per plot.
Multi-series line chart displaying a large number of trends over time, making individual trends difficult to distinguish.
A multi-series line chart clearly displaying three trends over time.

Chart properties

PropDefaultDescription
central tendencymean
mean
The sum of a set of values divided by the number of values in the set.
median
The middle most value of a sorted set of numbers.
errorSEM
standard error of the mean (SEM) mean
How much the sample means vary from the population mean.
standard deviation (SD) mean
A measure of the variation of a set of values around their mean.
95% confidence interval (95% CI) mean or median
95% probability that the population parameter lies within this range.
range mean or median
The difference between the highest and lowest values within a set.
Interquartile range (IQR) median
The middle 50% of a set of values (i.e. 3rd quartile - 1st quartile).
error formatareas
areas
Error shown as filled areas between dashed bounds.
bars
Visualize error as a set of upper and lower error bars.
pointsall
all
Show individual data points as dots.
leading
Show ONLY the leading data point as a dot.
false
Hide all individual data points.
linelinear
linear
Data points are connected by straight line segments.
curved
Data points are connected by curved line segments.
step before
Staircase-like line segments. The y-value changes before the x-value.
step after
Staircase-like line segments. The y-value changes after the x-value.