Report

Income Accounts

Shows a piechart with the Income per given time interval

A pie chart of the income accounts' totals between two dates, largest first, with the smallest slices merged into Other. Use it to see where your income comes from. In GnuCash: Reports ▸ Income & Expense ▸ Income Piechart.

The options that matter are Accounts/Accounts, Accounts/Levels of Subaccounts, General/Start Date and End Date and Display/Maximum Slices.

Examples

Example: with a copy of the reports/category-daily 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":"Income Accounts","options":{"Accounts":{"Accounts":["a0000000000000000000000000000003"]},"General":{"Start Date":{"absolute":"2024-03-01"},"End Date":{"absolute":"2024-03-31"}}}}}

Response:

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "title": "Income Accounts",
    "sections": [
      {
        "blocks": [
          {
            "kind": "chart",
            "type": "pie",
            "title": [
              "Income Accounts",
              "03/01/24 to 03/31/24: $496.00"
            ],
            "…": "…"
          },
          "…"
        ],
        "…": "…"
      },
      "…"
    ],
    "…": "…"
  }
}

Command line

red-ale exec --book book.gnucash report.run '{"report":"Income Accounts","options":{"Accounts":{"Accounts":["a0000000000000000000000000000003"]},"General":{"Start Date":{"absolute":"2024-03-01"},"End Date":{"absolute":"2024-03-31"}}}}'

It prints:

{
  "title": "Income Accounts",
  "sections": [
    {
      "blocks": [
        {
          "kind": "chart",
          "type": "pie",
          "title": [
            "Income Accounts",
            "03/01/24 to 03/31/24: $496.00"
          ],
          "…": "…"
        },
        "…"
      ],
      "…": "…"
    },
    "…"
  ],
  "…": "…"
}

MCP tool call

Tool call:

{"name":"report.run","arguments":{"report":"Income Accounts","options":{"Accounts":{"Accounts":["a0000000000000000000000000000003"]},"General":{"Start Date":{"absolute":"2024-03-01"},"End Date":{"absolute":"2024-03-31"}}}}}

Result:

{
  "structuredContent": {
    "title": "Income Accounts",
    "sections": [
      {
        "blocks": [
          {
            "kind": "chart",
            "type": "pie",
            "title": [
              "Income Accounts",
              "03/01/24 to 03/31/24: $496.00"
            ],
            "…": "…"
          },
          "…"
        ],
        "…": "…"
      },
      "…"
    ],
    "…": "…"
  }
}

Template GUID: e1bd09b8a1dd49dd85760db9d82b045c · 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 "Income Accounts"): 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.
  • 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.
  • Show Average (multichoice, default "None"): Select whether the amounts should be shown over the full time period or rather as the average e.g. per month.