Skip to main content
Get Started
Documentation

Stacked bar charts in Tractorscope

Stacked bar charts compare totals while showing the parts that make up each total. In Tractorscope, stacked bars are configured from the bar chart settings.

When to use stacked bars

Use stacked bars when you need to show composition by category or over time:
  • Revenue by month split by product
  • Tickets by week split by status
  • Orders by region split by channel
  • Active users by plan

SQL shape

A stacked bar chart usually needs:
  • One grouping column for the x-axis
  • One numeric value column
  • One series column, or multiple value columns that become series
select
  date_format(created_at, '%Y-%m') as month,
  plan,
  count(*) as accounts
from accounts
group by 1, 2
order by 1
select
  date_format(created_at, '%Y-%m') as month,
  plan,
  count(*) as accounts
from accounts
group by 1, 2
order by 1

Setup tips

  • Use a small number of series so the chart remains readable.
  • Use consistent color groups for recurring series.
  • Use grouped bars instead when exact side-by-side comparison matters more than total composition.

Related docs