Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
4049 มุมมอง

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

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
1
มี.ค. 15
7373
1
ส.ค. 16
5105
0
มี.ค. 15
4327
2
มี.ค. 21
4627
2
ต.ค. 19
9823