File: report

package info (click to toggle)
ledger 3.4.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,964 kB
  • sloc: cpp: 39,393; python: 4,476; perl: 1,309; sh: 477; lisp: 435; yacc: 103; makefile: 58
file content (21 lines) | stat: -rwxr-xr-x 538 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/sh

# This script facilities plotting of a ledger register report.  If you
# use OS/X, and have AquaTerm installed, you will probably want to set
# LEDGER_TERM to "aqua".
#
# Examples of use:
#
#   report -j -M reg food            # plot monthly food costs
#   report -J reg checking           # plot checking account balance

if [ -z "$LEDGER_TERM" ]; then
  LEDGER_TERM="x11 persist"
fi

(cat <<EOF; ledger "$@") | gnuplot
  set terminal $LEDGER_TERM
  set xdata time
  set timefmt "%Y-%m-%d"
  plot "-" using 1:2 with lines
EOF