Hi,
By default, Odoo’s Graph View provides options to switch between Bar, Line, and Pie charts, along with a Stacked toggle.
To restrict the view to only Bar charts and hide the other options (Pie, Line, and Stacked), you can use specific attributes in the <graph> tag within your XML view definition.
xml -
<record id="your_graph_view_id" model="ir.ui.view">
<field name="name">your.model.graph.view</field>
<field name="model">your.model</field>
<field name="arch" type="xml">
<graph string="Your Graph" type="bar"
disable_pie="1"
disable_line="1"
disable_stacked_bar="1">
<field name="your_group_by_field" type="row"/>
<field name="your_measure_field" type="measure"/>
</graph>
</field>
</record>
Explanation of Attributes-
type="bar": -Sets the default chart type to Bar.
disable_pie="1": Hides the Pie chart option from the toolbar.
disable_line="1": Hides the Line chart option.
disable_stacked_bar="1": Hides the Stacked toggle button.
Hope it helps