This question has been flagged

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);
},

Avatar
Discard