Attributes for Graph View in Odoo 16

ANJU
September 8, 2023
attributes-for-graph-view-in-odoo-16

In Odoo, there are various sorts of views, such as form views, list views, pivot views, and so on. The graph view is a form of Odoo view in which data is organized and shown as a graph that users can easily understand. The graph view is a data visualization tool. Odoo’s first views are the List or Tree view, Form view, and Pivot view.

Graph-View -in-Odoo-16

The image above is a graph view in Odoo.

There are various attributes for graph view in Odoo that may be used to adjust various aspects of it. In this blog, we will be covering the many aspects of the graph view.

1. string

It defines the string that should be displayed as the graph view’s marker.

<graph string="New Graph">

The string will be shown as the graph view’s title.

2. model

The name of the model in which the graph view will be built.

<graph string="New Graph" model="sale.order">

Put the model name in place of sale. order’.

3. type

<graph string="New Graph" type="line">

It specifies the type of graph that will be displayed in the view, such as a bar graph or a line graph.

The graph type will be determined by the type supplied in the graph label.

There are several types of graphs,
line, bar, pie, donut, area, smatter, radar

For the graph to appear with the features and style of the different graph kinds, we may provide these values with the keyword ‘type ‘.

Request Your Free Quote

4. sphere

We can use the sphere trait to filter the graph display based on certain conditions.

The data required to render the graph will be filtered based on the condition given within the sphere.

The graph view is then constructed in the sale. Order and only the verified trade orders are displayed in the view.

5. sample

The instance attribute is used to limit the number of records imported to join the graph. This means that when the view is loaded, the chart takes the template records to display the chart. However, this causes problems when displaying the graph when the graph retrieves data from a large database. Thus, the sample function limits the data loaded. The sample is then set to 1 so that 100 data are imported. If the sample value is set to 0.5, only 50 data will be imported. slice helps increase graphics performance. By using a slice, we can reduce the number of data points in the chart.

6. piled

The stack function is used to specify whether data of different orders should be displayed or stacked on top of each other, data, or data side by side.

graph string = ” New graph “ type = ” bar ” clustered = ” True “>

7. disable_linking

This property is used to prevent data displayed in a chart view from being linked to the corresponding form or tree views. This means that if disable_linking is set to 1 or True and a stoner tries to click on the chart data to navigate to the corresponding record, it will not navigate to the corresponding form or tree

view. However, a stoner can perfectly see the corresponding entry shown in the graph view by clicking on the graphic if it is set to 0 or not defined.

8. order

The order property is used to specify what chart data is displayed in ascending or descending order. graph string = “New graph” example = “1” order = “descending” Set “desc” for descent and “asc” for thrust.

9. group by

Using this feature, a chart can be grouped based on one or more fields in the model where the view is defined. Then the field used with the groupby attribute is team_id. In other words, the chart is grouped by the sales. order model field based on team_id. We can specify multiple fields in groups by separating the fields with a comma. For example: groupby = (“team_ids, user_ids”).

DOWNLOAD ERP

"Unlock the Full Potential of Your Business with Odoo ERP!"

"Get a Cost Estimate for Your ERP Project, Absolutely FREE!"

Get a Free Quote

Leave a Reply

Your email address will not be published. Required fields are marked *