Charts and Graphs
Tips and techniques for producing charts from hledger data.
Built-in charts
New in hledger 1.99.6 (2.0 preview 6): hledger can show many reports as a chart.
Add --chart to a balance, balancesheet, balancesheetequity, cashflow, incomestatement, register, aregister or holdings report;
the activity command always shows one.
A suitable kind of chart is chosen for the report: eg stacked bars per period for balance changes,
lines for balances over time, a bar per account for a single period,
or a bar per investment holding showing its cost basis and unrealised gain or loss.
In the terminal, the chart is drawn with text characters (in colour when supported):
$ hledger -f examples/sample.journal bal -Q expenses income --chart -w 50
Balance changes in 2008:
█ expenses:food ▓ expenses:supplies
▒ income:gifts ░ income:salary ┃ Total
2008Q1 $-1 ┃░░░░░░░░░░░│
2008Q2 $1 ▒▒▒▒▒▒▒▒▒▒▒▒│███████████┃▓▓▓▓▓▓▓▓▓▓▓▓
2008Q3 0 ┃
2008Q4 0 ┃
With SVG output (eg -o chart.svg) it is a graphical chart; with HTML output, the report's table is shown below it;
and with CSV, TSV or JSON output you get the chart's data.
To see a graphical chart quickly, in your web browser, add --view:
$ hledger -f examples/bcexample.journal is -M -p 2013 cur:USD --chart --view
And to collect several reports and charts into one page, use the run command with --view, eg
hledger run --view -- bs -M --chart -- is -M --chart.
Here is a page of example charts made that way, from examples/bcexample.journal,
each with its command and (under Report details) its report.
hledger-web shows the same charts, above the report on its All accounts, Balance sheet, Income statement,
Cashflow statement and Holdings pages, and a balance over time chart on its register page.
The c and d keys hide or show a page's chart and its table,
and with several commodities, a legend chooses the one charted.
$ hledger-web -f examples/bcexample.journal

For more, see Charts in the (dev) manual.
Charting tools built for hledger
Simplest first:
hledger-bar
hledger-bar (2023) is a bash script for making quick bar charts in the terminal. It's useful with hledger 1.x, or hledger 2.x previews up to 1.99.5.
$ hledger bar -v 1 -f $TIMELOG biz
2023-01 15 +++++++++++++++
2023-02 10 ++++++++++
2023-03 20 ++++++++++++++++++++
2023-04 12 ++++++++++++
hledger-plot
hledger-plot (2023) is a powerful chart-making addon you can install in PATH.

hledger-lit
hledger-lit (2025) is a nice web UI that makes several kinds of chart.
hledger-sankeymatic
At https://sankeymatic.com you can make flow diagrams in your browser,
from data records like Source [Amount] Target.
Here's a rough script that exports the outflows from several asset accounts:
LEDGER_FILE=examples/sample.journal
for f in checking saving cash; do
hledger areg $f -O tsv | tail +2 | sed -e "s/^/$f\t/"
done | cut -f1,6,7 | gsed -E -e 's/\$//' -e 's/([^\t]*)\t([^\t]*)\t([^\t]*)/\1 [\3] \2/' | grep '\[-' | gsed 's/\[-/[/'
hledger-sankeymatic is a better script to help you export hledger data to SankeyMATIC.
hledger-sankey
- https://github.com/adept/hledger-sankey is a python script using pandas and plotly to plot three sankey graphs of hledger data
- https://github.com/JustSaX/hledger-sankey is hledger-sankey made interactive with Streamlit

hledger-sankey-visualization
https://github.com/AlessandroW/hledger-sankey-visualization is a javascript that reads hledger's JSON output, and uses amCharts.

hledger-vega
hledger-vega (2022) is a set of scripts for producing custom charts from your hledger reports, using the powerful vega-lite.

r-ledger
r-ledger is an R package for making reports and charts from hledger, Ledger or Beancount.

Grafana export script
Visualise your finances with hledger, InfluxDB, and Grafana (2017)

docker-finance metadata visualising
docker-finance, a hledger-based system, can visualise large quantities of metadata using ROOT.

Other charting tools
Fava
You can export to Beancount format and then use Fava, a web UI with many charts. See Beancount output or (improved) Beancount output in 2.x.
Ledger chart tools
Tools built for Ledger can sometimes be adapted to work with hledger also; or, hledger data can be exported to Ledger-readable files. Eg:
- Report Scripts for Ledger CLI with Gnuplot (2016)
- ledger-plots (2018), an R package that makes PDF charts from Ledger
Spreadsheets
The most general, lowest-common-denominator way is to produce CSV output from a report,
then drag the CSV file into a spreadsheet and use its charting tools.
The balance command with --layout=bare and -N/--no-total is most often used. Eg:
hledger bal --layout bare -N expenses -o expenses.csv
ploterific
Here's another small example of plotting CSV data.
ploterific (stack install hvega-theme ploterific) produces simple charts,
in a HTML file that uses the Vega-Lite javascript library.
Charts can also be saved as SVG or PNG.
hledger -f examples/bcexample.journal bal -O csv -N expenses -3 cur:USD \
| sed 's/ USD//' \
| ploterific -m Bar -f account:N -f balance:Q -c account -o a.html \
&& open a.html
Let's break down that command line:
-f examples/bcexample.journal- use this example file in the hledger repo. Omit this to use your default journal.bal- run a balance report-O csv- show it as CSV on stdout-N- disable the final Total rowexpenses- limit to accounts whose name containsexpenses-3- summarise accounts to depth 3 and abovecur:USD- limit to balances inUSDcurrency. If you use the$symbol, it would becur:\\$.sed 's/ USD//g'- process the output with sed, stripping theUSDsymbols to leave bare numbers for ploterific. With$it would besed 's/\$//g'.-m Bar- useBaras the Vega-Lite mark type-f account:N- use theaccountcolumn as the first feature (X axis), treating values as names-f balance:Q- use thebalancecolumn as a second feature (Y axis), treating values as quantities-c account- useaccountvalues to select colours-o a.html- save into a temporary HTML file&& open a.html- and view it in your web browser, on Mac; on other systems it might bexdg-openorstart