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

Hello,

In openErp 7, is there any solution to force label in yaxis in web graph(Line graph) to be displayed with the thousand separator, for example:

10200===>>>10,200.00

Thanks

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

 In Sale Report Y-axis add amount with format using the below code:-

\addons\web_graph\static\src\js\graph.js

    make_graph: function (mode, container, data) {
if (mode === 'area') { mode = 'line'; }
var format = this.get_format(this['options_' + mode](data));
/* ADD Y axis Amount in Sale Report */
if (this.dataset.model == 'sale.report')
xy_value = data.data[0]['data'][0]; //xy_value contains x, y axis value 0, 10200
var str = xy_value.toString(); // Object value convert into string
var n = str.substr(str.indexOf(",") + 1); // Get aftercomma value
{
//format['xaxis']['title'] = 'x-axis title';
format['yaxis']['title'] = parseInt(n).toLocaleString('en-US', {minimumFractionDigits: 2}); //Format value
}
/* End */
return Flotr.draw(container, data.data, format);
},

อวตาร
ละทิ้ง
ผู้เขียน

Hi Prakash, thak you for your answer but this add a number in the left of Graph, not add a seprator to values in the yaxis

Related Posts ตอบกลับ มุมมอง กิจกรรม
0
พ.ค. 15
3483
1
ก.ย. 15
9099
2
ส.ค. 15
5448
0
ส.ค. 15
3246
0
พ.ค. 15
3175