dotfiles/.zsh/.functions/hl-pie
2026-08-15 19:39:06 +01:00

11 lines
481 B
Text

# PIE AND PROPORTIONAL RENDERING
# render proportional ascii bar and distribution chart
local chart_script="$HOME/.local/bin/hledger-charts"
local journal="${HLEDGER_JOURNAL:-$HOME/obsidian/finances/journals/2026.journal}"
if [[ -x "$chart_script" ]]; then
"$chart_script" pie --journal "$journal" "${@:-expenses}"
else
echo "warning: hledger-charts not found, defaulting to native percentage breakdown" >&2
hledger -f "$journal" balance "${@:-expenses}" --percent
fi