Report

Cash Flow Barchart

Shows a barchart with cash flow over time

A bar chart of the money into and out of the selected accounts in each step between two dates. It is the chart version of the Cash Flow report. Use it to see which days or months you spent more than you received. In GnuCash: Reports ▸ Income & Expense ▸ Cash Flow Barchart.

The options that matter are Accounts/Accounts, General/Start Date and End Date, and General/Step Size.

Examples

Example: with a copy of the reports/cashflow-barchart example book open as book.gnucash, at 2024-03-15T12:00:00Z.

JSON-RPC

Request:

{"jsonrpc":"2.0","id":1,"method":"report.run","params":{"report":"Cash Flow Barchart","options":{"Accounts":{"Accounts":["a0000000000000000000000000000003","a0000000000000000000000000000004"]},"General":{"Start Date":{"absolute":"2024-03-02"},"End Date":{"absolute":"2024-03-03"},"Step Size":"DayDelta"}}}}

Response:

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "title": "",
    "sections": [
      {
        "blocks": [
          {
            "kind": "chart",
            "type": "bar",
            "title": [
              "Cash Flow Barchart",
              "03/02/24 to 03/03/24"
            ],
            "…": "…"
          },
          "…"
        ],
        "…": "…"
      },
      "…"
    ],
    "…": "…"
  }
}

Command line

red-ale exec --book book.gnucash report.run '{"report":"Cash Flow Barchart","options":{"Accounts":{"Accounts":["a0000000000000000000000000000003","a0000000000000000000000000000004"]},"General":{"Start Date":{"absolute":"2024-03-02"},"End Date":{"absolute":"2024-03-03"},"Step Size":"DayDelta"}}}'

It prints:

{
  "title": "",
  "sections": [
    {
      "blocks": [
        {
          "kind": "chart",
          "type": "bar",
          "title": [
            "Cash Flow Barchart",
            "03/02/24 to 03/03/24"
          ],
          "…": "…"
        },
        "…"
      ],
      "…": "…"
    },
    "…"
  ],
  "…": "…"
}

MCP tool call

Tool call:

{"name":"report.run","arguments":{"report":"Cash Flow Barchart","options":{"Accounts":{"Accounts":["a0000000000000000000000000000003","a0000000000000000000000000000004"]},"General":{"Start Date":{"absolute":"2024-03-02"},"End Date":{"absolute":"2024-03-03"},"Step Size":"DayDelta"}}}}

Result:

{
  "structuredContent": {
    "title": "",
    "sections": [
      {
        "blocks": [
          {
            "kind": "chart",
            "type": "bar",
            "title": [
              "Cash Flow Barchart",
              "03/02/24 to 03/03/24"
            ],
            "…": "…"
          },
          "…"
        ],
        "…": "…"
      },
      "…"
    ],
    "…": "…"
  }
}

Template GUID: 5426e4d987f6444387fe70880e5b28a0 · Script: standard/cashflow-barchart.rhai

Options

Accounts

  • Accounts (accountList, default []): Report on these accounts.
  • Include Trading Accounts in report (boolean, default false): Include transfers to and from Trading Accounts in the report. As in GnuCash 5.17 this works backwards: off counts transfers to and from Trading Accounts, on leaves them out.

Display

  • Show Money In (boolean, default true): Show money in?
  • Show Money Out (boolean, default true): Show money out?
  • Show Net Flow (boolean, default true): Show net money flow?
  • Show Table (boolean, default false): Display a table of the selected data.
  • Plot Width (plotSize, default {"percent":100}): Width of plot, 10 - 100 in percent, above in pixels.
  • Plot Height (plotSize, default {"percent":100}): Height of plot, 10 - 100 in percent, above in pixels.

General

  • Report name (string, default "Cash Flow Barchart"): Enter a descriptive name for this report.
  • Stylesheet (multichoice, default "Default"): Select a stylesheet for the report.
  • Add options summary (multichoice, default "never"): Add summary of options.
  • Start Date (date, default {"relative":"start-accounting-period"}): Start of reporting period.
  • End Date (date, default {"relative":"end-accounting-period"}): End of reporting period.
  • Step Size (multichoice, default "MonthDelta"): The amount of time between data points.
  • Report's currency (currency, default "CURRENCY::USD"): Select the currency to display the values of this report in.
  • Price Source (multichoice, default "pricedb-nearest"): The source of price information.