Income & Expense Linechart
The Income & Expense Linechart report.
A line chart of the income and expense accounts' totals in each step between two dates, and the net profit between
them. It is the line version of the Income/Expense Chart. report.exportCsv returns
its data as CSV. In GnuCash: Reports ▸ Income & Expense ▸ Income & Expense Linechart.
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/net-days 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 & Expense Linechart","options":{"Accounts":{"Accounts":["a0000000000000000000000000000002","a0000000000000000000000000000003"]},"General":{"Start Date":{"absolute":"2024-03-01"},"End Date":{"absolute":"2024-03-31"},"Step Size":"WeekDelta"}}}}
Response:
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"title": "",
"sections": [
{
"blocks": [
{
"kind": "chart",
"type": "line",
"title": [
"Income & Expense Linechart",
"03/01/24 to 03/31/24"
],
"…": "…"
},
"…"
],
"…": "…"
},
"…"
],
"…": "…"
}
}
Command line
red-ale exec --book book.gnucash report.run '{"report":"Income & Expense Linechart","options":{"Accounts":{"Accounts":["a0000000000000000000000000000002","a0000000000000000000000000000003"]},"General":{"Start Date":{"absolute":"2024-03-01"},"End Date":{"absolute":"2024-03-31"},"Step Size":"WeekDelta"}}}'
It prints:
{
"title": "",
"sections": [
{
"blocks": [
{
"kind": "chart",
"type": "line",
"title": [
"Income & Expense Linechart",
"03/01/24 to 03/31/24"
],
"…": "…"
},
"…"
],
"…": "…"
},
"…"
],
"…": "…"
}
MCP tool call
Tool call:
{"name":"report.run","arguments":{"report":"Income & Expense Linechart","options":{"Accounts":{"Accounts":["a0000000000000000000000000000002","a0000000000000000000000000000003"]},"General":{"Start Date":{"absolute":"2024-03-01"},"End Date":{"absolute":"2024-03-31"},"Step Size":"WeekDelta"}}}}
Result:
{
"structuredContent": {
"title": "",
"sections": [
{
"blocks": [
{
"kind": "chart",
"type": "line",
"title": [
"Income & Expense Linechart",
"03/01/24 to 03/31/24"
],
"…": "…"
},
"…"
],
"…": "…"
},
"…"
],
"…": "…"
}
}
Template GUID: e533c998186b11e1b2e2001558291366 · Script: standard/net-charts.rhai
Options
Accounts
- Accounts (accountList, default
[]): Report on these accounts, if chosen account level allows.
Display
- Show Income/Expense (boolean, default
true): Show Income and Expenses? - Show Net Profit (boolean, default
true): Show the net profit? - 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. - Line Width (numberRange, default
"1.5"): Set line width in pixels. - Grid (boolean, default
true): Add grid lines. - Show a grouped (indexed) tooltip (boolean, default
true): Show all items, along the x-axis, in a grouped tooltip. Otherwise - only a single entry, as per coursor's nearest proximity. - Show only non-zero values in a tooltip (boolean, default
true): Show only non-zero values in a tooltip.
General
- Report name (string, default
"Income & Expense Linechart"): 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
"weighted-average"): The source of price information.