report 538 B

123456789101112131415161718192021
  1. #!/bin/sh
  2. # This script facilities plotting of a ledger register report. If you
  3. # use OS/X, and have AquaTerm installed, you will probably want to set
  4. # LEDGER_TERM to "aqua".
  5. #
  6. # Examples of use:
  7. #
  8. # report -j -M reg food # plot monthly food costs
  9. # report -J reg checking # plot checking account balance
  10. if [ -z "$LEDGER_TERM" ]; then
  11. LEDGER_TERM="x11 persist"
  12. fi
  13. (cat <<EOF; ledger "$@") | gnuplot
  14. set terminal $LEDGER_TERM
  15. set xdata time
  16. set timefmt "%Y-%m-%d"
  17. plot "-" using 1:2 with lines
  18. EOF