How get the category value in Dashboard, when i clicking the show data button x value come as 0,1,2,... I want to replace the 0 by that product category name. see the attachment i want some values x axis.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Accounting
- Inventory
- PoS
- Project management
- MRP
This question has been flagged
1
Reply
3944
Views
Default Dashboard show data x value come as 0,1,2,... from the below code:-
Folder: addons\web_graph\static\lib\flotr2\js\plugins\spreadsheet.js
Default OpenERP Code:-
function getRowLabel(value){
if (this.options.spreadsheet.tickFormatter){
//TODO maybe pass the xaxis formatter to the custom tick formatter as an opt-out?
return this.options.spreadsheet.tickFormatter(value);
}
else {
var t = _.find(this.axes.x.ticks, function(t){return t.v == value;});
if (t) {
return t.label;
}
return value; /* Default it shows 0, 1, 2 */
}
}
Based on your requirement to change the below code in spreadsheet.js its shows Product Category Name in x-axis
function getRowLabel(value){
if (this.options.spreadsheet.tickFormatter){
//TODO maybe pass the xaxis formatter to the custom tick formatter as an opt-out?
return this.options.spreadsheet.tickFormatter(value);
}
else {
var t = _.find(this.axes.x.ticks, function(t){return t.v == value;});
if (t) {
return t.label;
}
return this.options.xaxis.ticks[value][1]; /* It return x-axis value in Data Dashboard */
}
}
Yes Yes... It is working... Thank You...