summaryrefslogtreecommitdiff
path: root/scripts/report
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/report')
-rwxr-xr-x[-rw-r--r--]scripts/report28
1 files changed, 16 insertions, 12 deletions
diff --git a/scripts/report b/scripts/report
index aa42982e..24418cdc 100644..100755
--- a/scripts/report
+++ b/scripts/report
@@ -1,17 +1,21 @@
#!/bin/sh
-dir=$HOME/doc/finance
+# 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
-cd /tmp
+if [ -z "$LEDGER_TERM" ]; then
+ LEDGER_TERM="x11 persist"
+fi
-ledger -M -G register "$@" > $1
-
-gnuplot <<EOF
-set terminal png
-set output "report.png"
-set xdata time
-set timefmt "%Y/%m/%d"
-plot "$1" using 1:2 with linespoints
+(cat <<EOF; ledger "$@") | gnuplot
+ set terminal $LEDGER_TERM
+ set xdata time
+ set timefmt "%Y/%m/%d"
+ plot "-" using 1:2 with lines
EOF
-
-open report.png