Generates an SVG chart displaying weekly financial expenses split into categories.
The simplest way is using stack, available in the repositories of many Linux distributions. You can build and run nickel in your shell with:
stack build
stack exec nickel < example-data
The input data is read from the standard input. Each expense item is stored in a line with the following fields separated by whitespace:
- The minus sign character:
-
- The date in
yyyy-mm-dd
format - The expense amount
- The category of the expense item. It can be enclosed by quotation marks to escape spaces.
- Description -- currently unused. It can be enclosed by quotation marks to escape spaces. For an example see the example file.
The output file weekly.svg
is placed in the current directory.
Each tick on the horizontal axis labeled with a month represents the week of the first day of that month. The bars show the total expenses, the lines show rolling averages for each week. The rolling averages are displayed until the previous week (based on the system time). The categories are ordered by the number of expense items descending.