AI Glossary / Data science and analytics / Intermediate
Line chart
Definition
A line chart displays values as points connected in an ordered sequence, commonly to show change over time. One axis represents the ordering variable, such as date, and the other represents a measured value. The connecting line helps viewers follow movement and compare patterns. It does not establish what happened between observations or explain why a change occurred.
What it means
A table is useful for exact values, while a line chart can make trends, turning points, and recurring patterns easier to see. For example, weekly request counts may reveal a gradual rise that is difficult to notice across many spreadsheet rows. The order matters: connecting unrelated categories can imply a progression that the data do not have. A line chart should therefore use a meaningful sequence and a clearly defined measure.
How it works
Arrange observations by the horizontal variable, plot each value at its proper position, and connect points according to the intended convention. Label the axes, units, series, and reporting period. Decide how to represent missing data, estimates, and revisions. For multiple series, use a consistent scale where direct comparisons are intended and avoid making the chart too crowded. A line joining two observed points is a visual connection; if it is also intended as an interpolation, that assumption should be stated.
Three practical examples
- Service monitoring: a team tracks weekly request volume to investigate demand changes and plan capacity.
- Model evaluation: training and validation losses are plotted by training step to inspect how their patterns differ.
- Household planning: a person charts monthly electricity usage to compare seasons and identify periods worth investigating.
Think of it this way
Think of following checkpoints along a route. The line helps the eye move from one recorded position to the next. The analogy is limited because the actual journey between checkpoints may differ from the straight connection, and an upward line in a business chart is not automatically an improvement.
Worked example
Suppose a system records 100 requests on day 1, 110 on day 2, and 140 on day 5. With a numerical time axis, day 5 is three days after day 2, so the horizontal gap is three times the gap between days 1 and 2. The average change over the first interval is (110 minus 100)/1 = 10 requests per day. Over the second interval it is (140 minus 110)/3 = 10 per day.
If the three dates are drawn equally far apart as text categories, the second line segment looks much steeper even though the interval-average rate is the same. If daily observations for days 3 and 4 are missing, connecting day 2 directly to day 5 also risks suggesting an observed smooth rise. The chart can instead show a gap, or clearly label a chosen interpolation. Values of 120 and 130 would be a linear interpolation, not measured counts. The chart must preserve that distinction.
Illustrative case study
In a fictional operations review, a line chart shows a sharp increase in average handling time after a new system launches. The team initially attributes the rise to the system. A review finds that the reporting definition also changed to include a waiting stage previously excluded. The analysts annotate the break, rebuild a comparable measure where possible, and investigate performance separately. The case illustrates that visual timing can reveal a question without proving causation or comparability.
Common misconceptions and mistakes
A line chart is not automatically a forecast. Extending a line beyond observed data introduces a prediction or assumption that needs identification. Smoothing can hide short spikes, and monthly averages can conceal important within-month variation. A missing value is not a zero. Two lines moving together do not prove that one drives the other. For an ordinary line chart, the vertical axis need not always start at zero, but its range must be clear and chosen to support an honest reading of the magnitude of change.
Business use
Choose a line chart when the decision involves change along a meaningful sequence. Keep the measure consistent across periods and mark changes in definitions, coverage, or collection methods. Show uncertainty when it is material, and distinguish observed history from forecasts with clear labeling. Include a table or accessible values when users need exact numbers. When comparing several series, consider separate aligned panels rather than relying on many overlapping lines or unrelated vertical scales. Review whether the chart's visual emphasis matches the operational significance of the change.
People also ask
Must a line chart show time?
No. It can use another meaningfully ordered numerical variable.
Should missing data be plotted as zero?
No, unless zero is the actual observed value.
Does a steep line always mean a large change?
Its appearance depends on both axis scales and the chart's proportions, so read the units and values.
Check your understanding
Why do the two intervals in the example have the same average change despite increases of 10 and 30 requests?
Answer: The first increase occurs over one day and the second over three days. Both equal 10 requests per day on average across their respective intervals.
Related terms
- Time series
- Moving average
- Missing data
- Data visualization
- trend
- interpolation
- axis scale
- forecast
- seasonality
Learn next
Plot a short series using actual dates and compare it with equally spaced text labels. Add a missing period and decide how to display it without inventing an observation. Then compare raw values with a moving average and describe which features the smoother hides.
More in Data science and analytics
- Labeled data - Labeled data are examples paired with target information for a defined learning or evaluation task.
- Latent variable - A latent variable is a variable included in a model but not directly observed in the available data.
- Lift - Lift is a ratio that compares an observed or model-selected outcome with a stated baseline.
- List - A list is an ordered collection of elements. In programming, the exact operations and implementation depend on the language.
- Local outlier factor - Local outlier factor, or LOF, is a method that scores how unusual an observation is relative to the density around its neighbors.
- Logarithm - A logarithm gives the exponent needed to raise a specified base to a positive number. If b raised to y equals x, then log base b of x equals y.
Sources
Office for National Statistics, line-chart guidance and gaps: https://service-manual.ons.gov.uk/data-visualisation/chart-types/line-chart ONS, vertical-axis interpretation for line charts: https://digitalblog.ons.gov.uk/2016/06/27/does-the-axis-have-to-start-at-zero-part-1-line-charts/ Matplotlib, representing missing values with gaps: https://matplotlib.org/3.10.8/gallery/lines_bars_and_markers/masked_demo.html
Previous: Lindley's paradox Next: Line intersection