Odoo Help


Add custom title in X-axis and Y-axis in OpenERP 7 Graph view

Walid Berrad
on 5/20/15, 4:10 PM 865 views

I want to add a text (legend) for the X-axis and the Y-axis in a graph in OpenERP 7. My model contains many fields that will be displayed each one in a separate graph. I tried to make some changes in "server\openerp\addons\web_graph\static\src\js\graph.js"  (as mentioned below) but this displays the same text for all fields. I'd like to add a custom text for each field (the name of the field for example), how can I do this ?

the code below display a condition for the model, i'd like to make a condition for the field in that model.

make_graph: function (mode, container, data) {
if (mode === 'area') { mode = 'line'; }
var format = this.get_format(this['options_' + mode](data));
/* The next if statement is made on the model tdb_moulin */
if (this.dataset.model == 'tdb_moulin')
format['xaxis']['title'] = 'name_of_field_in_x_axis';
format['yaxis']['title'] = 'name_of_field_in_y_axis';
return Flotr.draw(container, data.data, format);

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 5/20/15, 4:10 PM
Seen: 865 times
Last updated: 5/20/15, 4:10 PM