Custom dashboards in Fava

258 views
Skip to first unread message

Andreas Gerstmayr

unread,
Mar 12, 2023, 7:03:53 PM3/12/23
to bean...@googlegroups.com
Hi everyone,

I've written a new Fava extension which may be of interest to some of
you interested in additional Fava charts.

It allows creating custom dashboards in Fava, combining Beancount
queries and Apache ECharts.
The dashboards are defined in a `dashboards.yaml` configuration file,
where each panel includes one or multiple Beancount queries
and a `script` field, which transforms the Beancount query results into
a valid ECharts configuration.

Example dashboards, screenshots and installation instructions are in the
project repository:
https://github.com/andreasgerstmayr/fava-dashboards

A blog post explaining the basic structure of the Fava extension:
https://www.andreasgerstmayr.at/2023/03/12/dashboards-with-beancount-and-fava.html

P.S.: I'm not 100% sure if I got all the queries in the example
dashboards right, especially the portfolio ones.
Please let me know if you find any issues or have suggestions!


Cheers,
Andreas

Red S

unread,
Mar 15, 2023, 1:40:59 PM3/15/23
to Beancount
This is awesome! Been wanting to do this for a while, glad to see it done well!

Looks nice and simple, and thanks for the great documentation.

Josh D

unread,
Mar 16, 2023, 5:07:14 AM3/16/23
to Beancount
Looks great! Where should the dashboards.yaml file be saved for the plugin to locate it?

Andreas Gerstmayr

unread,
Mar 16, 2023, 6:05:08 PM3/16/23
to bean...@googlegroups.com, Josh D
Hi,

Am 16.03.23 um 10:07 schrieb Josh D:
> Looks great! Where should the dashboards.yaml file be saved for the
> plugin to locate it?

by default the plugin looks for a dashboards.yaml file in the same
directory where Fava was started, for example if you run "fava
personal.beancount", the dashboards.yaml file should be in the same
directory as personal.beancount.

Thanks for the question, I forgot to describe this part in the README.
I've added a new paragraph about this now, and also show how to
customize the location of the configuration file.

Great that there's interest for this :)
I think with the current plugin there are tons of possibilities for
customization (i.e. additional (e)charts, or HTML panels), I'd be happy
to collect and share various dashboards in the repo.


Cheers,
Andreas

>
> On Thursday, March 16, 2023 at 1:40:59 AM UTC+8 Red S wrote:
>
> This is awesome! Been wanting to do this for a while, glad to see it
> done well!
>
> Looks nice and simple, and thanks for the great documentation.
> On Sunday, March 12, 2023 at 4:03:53 PM UTC-7 and...@gerstmayr.me wrote:
>
> Hi everyone,
>
> I've written a new Fava extension which may be of interest to
> some of
> you interested in additional Fava charts.
>
> It allows creating custom dashboards in Fava, combining Beancount
> queries and Apache ECharts.
> The dashboards are defined in a `dashboards.yaml` configuration
> file,
> where each panel includes one or multiple Beancount queries
> and a `script` field, which transforms the Beancount query
> results into
> a valid ECharts configuration.
>
> Example dashboards, screenshots and installation instructions
> are in the
> project repository:
> https://github.com/andreasgerstmayr/fava-dashboards
> <https://github.com/andreasgerstmayr/fava-dashboards>
>
> A blog post explaining the basic structure of the Fava extension:
> https://www.andreasgerstmayr.at/2023/03/12/dashboards-with-beancount-and-fava.html <https://www.andreasgerstmayr.at/2023/03/12/dashboards-with-beancount-and-fava.html>
>
> P.S.: I'm not 100% sure if I got all the queries in the example
> dashboards right, especially the portfolio ones.
> Please let me know if you find any issues or have suggestions!
>
>
> Cheers,
> Andreas
>
> --
> You received this message because you are subscribed to the Google
> Groups "Beancount" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to beancount+...@googlegroups.com
> <mailto:beancount+...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/beancount/76b0d7da-5315-4d46-92ab-6bb32b13bea6n%40googlegroups.com <https://groups.google.com/d/msgid/beancount/76b0d7da-5315-4d46-92ab-6bb32b13bea6n%40googlegroups.com?utm_medium=email&utm_source=footer>.

fin

unread,
Mar 18, 2023, 2:05:55 PM3/18/23
to bean...@googlegroups.com
Andreas Gerstmayr wrote:
> Hi,

hello,

i hope it uses the environment variable BEAN_ROOT if that is
defined?


fin

Andreas Gerstmayr

unread,
Mar 20, 2023, 5:47:57 PM3/20/23
to bean...@googlegroups.com
Hi Fin,

Am 18.03.23 um 19:05 schrieb fin:
> Andreas Gerstmayr wrote:
>> Hi,
>
> hello,
>
> i hope it uses the environment variable BEAN_ROOT if that is
> defined?

The plugin currently doesn't use this environment variable. I looked at
the beancount and fava sources, and neither reads or sets this
environment variable.

Can you explain your use case, how do you start fava?

You can also specify the path to the dashboards.yaml file directly if
the default path doesn't work for your use case:

2010-01-01 custom "fava-extension" "fava_dashboards" "{
'config': '/path/to/dashboards.yaml'
}"


Cheers,
Andreas

fin

unread,
Mar 23, 2023, 5:38:08 PM3/23/23
to bean...@googlegroups.com
Andreas Gerstmayr wrote:
> Hi Fin,
>
> Am 18.03.23 um 19:05 schrieb fin:
>> Andreas Gerstmayr wrote:
>>> Hi,
>>
>> hello,
>>
>> i hope it uses the environment variable BEAN_ROOT if that is
>> defined?
>
> The plugin currently doesn't use this environment variable. I looked at
> the beancount and fava sources, and neither reads or sets this
> environment variable.

i spent a while last night trying to find where this was
mentioned and why. i could not find it either.


> Can you explain your use case, how do you start fava?

i thought it was just a method to make sure that you
were referencing the right ledger and directories.

if it isn't needed then i can eliminate that from my
.bashrc startup script which looks for where i am working
in a terminal and sets things for me that each project
might require.


> You can also specify the path to the dashboards.yaml file directly if
> the default path doesn't work for your use case:
>
> 2010-01-01 custom "fava-extension" "fava_dashboards" "{
> 'config': '/path/to/dashboards.yaml'
> }"

ok. i've since pretty much abandoned fava for my
needs because bean-report is much quicker.


fin

bigsas parabiago

unread,
Mar 31, 2023, 7:01:58 AM3/31/23
to Beancount
i have got this errore when used my beancount file
[invalid data returned in API request:validating object failed at key 'source': Validating object failed]
Reply all
Reply to author
Forward
0 new messages