Report

Assets

Shows a piechart with the Assets balance at a given time

A pie chart of the asset accounts' balances at a date, largest first, with the smallest slices merged into one Other. Use it to see where your assets sit. Each slice links to a report of its account. In GnuCash: Reports ▸ Assets & Liabilities ▸ Asset Piechart.

The options that matter are Accounts/Accounts, General/End Date (the date of the balances), Display/Maximum Slices and Display/Sort Method. Negative balances cannot be drawn in a pie, and a report with no positive balance shows a No data warning in place of the chart.

Examples

Example: with a copy of the reports/test-data 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":"Assets","options":{"General":{"End Date":{"absolute":"1978-12-31"}}}}}

Response:

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "title": "Assets",
    "sections": [
      {
        "blocks": [
          {
            "kind": "chart",
            "type": "pie",
            "title": [
              "Assets",
              "Balance at 12/31/78: $3,057.80"
            ],
            "…": "…"
          },
          "…"
        ],
        "…": "…"
      },
      "…"
    ],
    "…": "…"
  }
}

Command line

red-ale exec --book book.gnucash report.run '{"report":"Assets","options":{"General":{"End Date":{"absolute":"1978-12-31"}}}}'

It prints:

{
  "title": "Assets",
  "sections": [
    {
      "blocks": [
        {
          "kind": "chart",
          "type": "pie",
          "title": [
            "Assets",
            "Balance at 12/31/78: $3,057.80"
          ],
          "…": "…"
        },
        "…"
      ],
      "…": "…"
    },
    "…"
  ],
  "…": "…"
}

MCP tool call

Tool call:

{"name":"report.run","arguments":{"report":"Assets","options":{"General":{"End Date":{"absolute":"1978-12-31"}}}}}

Result:

{
  "structuredContent": {
    "title": "Assets",
    "sections": [
      {
        "blocks": [
          {
            "kind": "chart",
            "type": "pie",
            "title": [
              "Assets",
              "Balance at 12/31/78: $3,057.80"
            ],
            "…": "…"
          },
          "…"
        ],
        "…": "…"
      },
      "…"
    ],
    "…": "…"
  }
}

Template GUID: 5c7fd8a1fe9a4cd38884ff54214aa88a · Script: standard/account-piecharts.rhai

Options

Accounts

  • Accounts (accountList, default []): Report on these accounts, if chosen account level allows.
  • Levels of Subaccounts (multichoice, default 2): Maximum number of levels in the account tree displayed.

Display

  • Show long names (boolean, default false): Show the full account name in legend?
  • Show Totals (boolean, default true): Show the total balance in legend?
  • Show Percents (boolean, default true): Show the percentage in legend?
  • Maximum Slices (numberRange, default 7): Maximum number of slices in pie.
  • 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.
  • Sort Method (multichoice, default "amount"): Choose the method for sorting accounts.

General

  • Report name (string, default "Assets"): 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.
  • End Date (date, default {"relative":"end-accounting-period"}): Select a date to report on.
  • 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.