dashboard_graph
The little line and bar charts on Odoo's accounting dashboard are a text field and a Chart.js canvas. One attribute decides which chart you get, and there is no third option.
| Technical name | dashboard_graph |
|---|---|
| Field types | text |
| Views | kanban |
| Module | web, present in every Odoo database |
| Used in core | 1 occurrence in Odoo 19, the accounting journal dashboard kanban |
| Versions | Odoo 20.0, Odoo 19.0, Odoo 18.0, Odoo 17.0, Odoo 16.0 |
| No-code setup | No. The chart data has to be computed server side into a JSON text field |
| Alternatives | picking_type_dashboard_graph, workcenter_dashboard_graph, gauge, percentpie |
What the dashboard graph field does
What this means for your team
Supported options in Odoo 19
| Option | Type | What it does |
|---|---|---|
graph_type | string (attribute) | Written on the field element, not in options. Accepts line or bar. Declared as a required string prop, and any other value leaves the chart without a configuration. |
is_sample_data | key in the JSON payload | Set by the server. Fades the line chart's colors and disables tooltips on both chart types, so demo data reads as demo data.(default: false) |
type | key on each bar data point | Set by the server. Colors the bar: one color for past, another for future, and a neutral grey for anything else. |
Only two chart types exist. The render method builds a configuration for line and for bar and does nothing for any other value, so a typo leaves the chart constructor without a configuration rather than falling back to a default. The prop is also declared as a required string, so omitting the attribute entirely is a props error.
Working examples
Parsed once, and two different sample-data rules
Version compatibility
| Version | Status | Notes |
|---|---|---|
| Odoo 20.0 | Partial / changed | Not released. The widget remains, but accounting moves to its own copy and Point of Sale becomes the core user. |
| Odoo 19.0 | Verified | Verified against the shipped source. Byte-identical to Odoo 18. |
| Odoo 18.0 | Verified | Same contract. New color palette indices, tooltips disabled on sample data, dark-scheme aware axis colors. |
| Odoo 17.0 | Verified | Same attribute and JSON contract, older palette and no sample-data tooltip handling. |
| Odoo 16.0 | Verified | Same attribute and JSON contract. The colors helper lived elsewhere and Chart.js was loaded as a single script. |
Upgrade note. The attribute and the JSON contract are unchanged from Odoo 16 through Odoo 19, so views and server-side computations carry over. What changed in Odoo 18 is entirely visual: the color palette indices were re-picked against the newer color helper, tooltips became disabled on sample data, and the bar chart's grid and label colors became aware of the dark scheme. Odoo 18 and Odoo 19 are byte-identical.
What is changing in Odoo 20
Common problems and fixes
| Symptom | Cause and fix |
|---|---|
| The card shows an empty space where the chart should be | The graph_type attribute is missing or is neither line nor bar, so no chart configuration is built. Set graph_type="line" or graph_type="bar", or compute it with a t-att expression. |
| A JSON parse error in the console | The field does not contain valid JSON, most often because it is empty on a new record. Make the server-side compute return a valid array, using an empty values list when there is nothing to show. |
| The chart does not update after the data changes | The JSON is parsed once when the component starts and the redraw uses that copy. Reload the kanban so the cards are recreated. |
| Bars are all grey | The data points carry no type, or a type other than past or future. Set the type key on each point in the server-side computation. |
| Tooltips do not appear | The payload is flagged as sample data, which disables them on both chart types. Expected on a demo database. Clear the flag once real data exists. |
| The line chart looks washed out | Sample data fades the border and fill colors, on the line chart only. Expected. Bar charts keep their colors even when flagged. |
| Missing widget error after upgrading to Odoo 20 | Accounting views switch to a dedicated widget name on the development branch. The base widget still exists; check which name your inherited view is using. |
Dashboard graph field vs the alternatives
| Widget | Best for | Key difference |
|---|---|---|
dashboard_graph | Compact charts on kanban cards, driven by a server-computed JSON field | Reads a JSON text field and draws a Chart.js sparkline with no axes and no interaction |
| picking_type_dashboard_graph | The same idea on inventory operation types | Adds a third color bucket for the present day and its own click targets |
workcenter_dashboard_graph | The same idea on manufacturing work centers | Work center specific data and click handling |
gauge | A single value against a target | One number rendered as an arc rather than a series |
| percentpie | A proportion on a card | A single percentage, no time series |
Frequently asked questions
How do I choose between a line and a bar chart?+
What does the field have to contain?+
Why does the chart not refresh when the data changes?+
What is the sample data flag for?+
Can I use it outside the accounting dashboard?+
Want a dashboard your team opens every morning?
Kanban charts, computed KPIs and the server-side queries behind them are a small build with a long life, as long as the numbers are the ones your business actually steers by. We design and build those dashboards inside Odoo, on versions 16 through 19.
Book a free consultation