Get Started →
Trend Time SeriesNumerical

Line Chart

ggplot2: geom_line() · Package: ggplot2 · Variables: 1 temporal + 1-7 numerical series

WHAT IS A LINE CHART?

A line chart connects data points with straight lines to show how values change over a continuous dimension, most commonly time. It is the default chart for time-series data — answering "how has this metric changed over time?" Line charts can show multiple series on the same axes for comparison (e.g., revenue by product over months). They work best with at least 5-7 data points and an ordered x-axis. In ggplot2, use geom_line() and optionally geom_point() to mark individual data points.

BEST FOR

  • · Trends over time
  • · Comparing multiple series
  • · Continuous data patterns
  • · Forecasting context

AVOID WHEN

  • · Categorical/unordered x-axis
  • · Fewer than 4 data points
  • · Unconnected discrete categories

R + GGPLOT2 CODE EXAMPLE

ggplot2
ggplot(economics, aes(x = date, y = unemploy)) +
  geom_line(color = "#ff6a00", linewidth = 0.8) +
  labs(title = "US Unemployment Over Time", x = "Date", y = "Unemployed (thousands)")

Run this code now

Paste the code above into RChat and see the line chart rendered instantly in your browser.

Try RChat Free →

SIMILAR CHART TYPES

ALTERNATIVES FOR YOUR DATA TYPE