Advanced Views - Odoo Graph View | Odoo 14 Development Tutorial
Graph views provide a graphical view of the data, in the form of Bar chart, Pie chart, and Line chart. The graph view is an aggregation of all the records in a model, which is generally visualized in bar, pie, and line. The default type of graph is a pie chart - to change it to a bar chart, we need to specify the type. You also may change the orientation.
Video Content:
0:00 - Introduction to the Graph view
1:10- How to Define model and views for Graph view
6:08 - Working demo of the Graph view
Get the module from our repository: https://github.com/CybroOdoo/openacademy
The graph view is used to visualize aggregations over a number of records or record groups. Its root element is 〈graph〉
which can take the following attributes:
type
one of bar (default), pie and line, the type of graph to use
stacked
only used for bar charts. If present and set to True, stacks bars within a group
The only allowed element within a graph view is a field that can have the following attributes:
name (required)
the name of a field to use in the view. If used for grouping (rather than aggregating)
title (optional)
string displayed on the top of the graph.
type
indicates whether the field should be used as a grouping criteria or as an aggregated value within a group. Possible values are:
row (default)
groups by the specified field. All graph types support at least one level of grouping, some may support more.
col
authorized in graph views but only used by pivot tables
measure
field to aggregate within a group
interval
on date and datetime fields, groups by the specified interval (day, week, month, quarter or year) instead of grouping on the specific datetime (fixed second resolution) or date (fixed day resolution).