I don't know whether this might fit what you're looking after, but the
approach I have been using for a while (and which I am satisfied with) is
to let Ledger output the data in tabular format, then feed the output to
some plotting program. With some scripting, this is easily automated.
I use R, but you may as well use whatever app able to read CSV (including
{Libre|Open}Office). As an example, my Ledger bundle for TextMate is able
to plot charts if R is installed
(
https://github.com/lifepillar/Ledger.tmbundle).
TextMate is OS X only, though.
To export the data in a way that I may draw nearly any imaginable plot, I
use three formats. One for register/periodic reports, with these fields:
date; year; month; month_num; wday; wday_num; week; mday; amount;
total; payee; account
which is generated with this option (one line):
--format
'%(format_date(date,\"%Y-%m-%d;%Y;%b;%m;%a;%u;%W;%d\"));%(quantity(scrub(display_amount)));%(quantity(scrub(display_total)));%(payee);%(display_account)\n'
One for balance reports, with these fields:
balance; uncleared; account; partial_account
--format '%(quantity(scrub(get_at(display_total,
0))));%(quantity(scrub(get_at(display_total,
1))));%(account);%(partial_account)\n%/'
Finally, one for budget reports, with these fields:
actual; budgeted; remaining; used; account; partial_account
--format '%(quantity(scrub(get_at(display_total,
0))));%(get_at(display_total, 1) ?
quantity(-scrub(get_at(display_total, 1))) :
0.0);%(get_at(display_total, 1) ? (get_at(display_total, 0) ?
quantity(-scrub(get_at(display_total, 1) + get_at(display_total, 0))) :
quantity(-scrub(get_at(display_total, 1)))) :
quantity(-scrub(get_at(display_total, 0))));%(get_at(display_total, 1)
? quantity(100% * (get_at(display_total, 0) ?
scrub(get_at(display_total, 0)) : 0.0) / -scrub(get_at(display_total,
1))) : "na");%(account);%(partial_account)\n%/'
They are horribly complicated, but they get the job done beautifully. I
do not type them all the time, of course: I use a Vim command that
prints a report in any of those formats.
Enjoy,
Life