|
@@ -306,7 +306,7 @@ function chart_sale_by_store (widget) {
|
|
var total = order_total + invoice_total;
|
|
var total = order_total + invoice_total;
|
|
data.push(total);
|
|
data.push(total);
|
|
});
|
|
});
|
|
- self.fetchChart(data,title);
|
|
|
|
|
|
+ self.fetchChart(data,title,CurrencyBase);
|
|
},
|
|
},
|
|
|
|
|
|
showWeek: function () {
|
|
showWeek: function () {
|
|
@@ -343,7 +343,7 @@ function chart_sale_by_store (widget) {
|
|
var total = order_total + invoice_total;
|
|
var total = order_total + invoice_total;
|
|
data.push(total);
|
|
data.push(total);
|
|
});
|
|
});
|
|
- self.fetchChart(data,title);
|
|
|
|
|
|
+ self.fetchChart(data,title,CurrencyBase);
|
|
},
|
|
},
|
|
|
|
|
|
showToday: function (){
|
|
showToday: function (){
|
|
@@ -381,27 +381,27 @@ function chart_sale_by_store (widget) {
|
|
var total = order_total + invoice_total;
|
|
var total = order_total + invoice_total;
|
|
data.push(total);
|
|
data.push(total);
|
|
});
|
|
});
|
|
- self.fetchChart(data,title);
|
|
|
|
|
|
+ self.fetchChart(data,title,CurrencyBase);
|
|
},
|
|
},
|
|
|
|
|
|
- fetchChart: function (data,title) {
|
|
|
|
|
|
+ fetchChart: function (data,title,CurrencyBase) {
|
|
var self = this;
|
|
var self = this;
|
|
var label = title;
|
|
var label = title;
|
|
var body = data;
|
|
var body = data;
|
|
|
|
|
|
- Chart.scaleService.updateScaleDefaults('linear', {
|
|
|
|
- ticks: {
|
|
|
|
- callback: function(tick) {
|
|
|
|
- return tick.toLocaleString('de-DE');
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
|
|
+ // Chart.scaleService.updateScaleDefaults('linear', {
|
|
|
|
+ // ticks: {
|
|
|
|
+ // callback: function(tick) {
|
|
|
|
+ // return tick.toLocaleString('de-DE');
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ // });
|
|
|
|
|
|
- Chart.defaults.global.tooltips.callbacks.label = function(tooltipItem, data) {
|
|
|
|
- var dataset = data.datasets[tooltipItem.datasetIndex];
|
|
|
|
- var datasetLabel = dataset.label || '';
|
|
|
|
- return datasetLabel + dataset.data[tooltipItem.index].toLocaleString('de-DE');
|
|
|
|
- };
|
|
|
|
|
|
+ // Chart.defaults.global.tooltips.callbacks.label = function(tooltipItem, data) {
|
|
|
|
+ // var dataset = data.datasets[tooltipItem.datasetIndex];
|
|
|
|
+ // var datasetLabel = dataset.label || '';
|
|
|
|
+ // return datasetLabel + dataset.data[tooltipItem.index].toLocaleString('de-DE');
|
|
|
|
+ // };
|
|
|
|
|
|
var chart = new Chart(this.$el.find(".widget-content").find('canvas'), {
|
|
var chart = new Chart(this.$el.find(".widget-content").find('canvas'), {
|
|
type: 'horizontalBar',
|
|
type: 'horizontalBar',
|
|
@@ -436,10 +436,6 @@ function chart_sale_by_store (widget) {
|
|
title: {
|
|
title: {
|
|
display: false,
|
|
display: false,
|
|
},
|
|
},
|
|
- hover: {
|
|
|
|
- mode: 'nearest',
|
|
|
|
- intersect: true
|
|
|
|
- },
|
|
|
|
legend: {
|
|
legend: {
|
|
display: false,
|
|
display: false,
|
|
},
|
|
},
|
|
@@ -451,7 +447,19 @@ function chart_sale_by_store (widget) {
|
|
rigth: 0,
|
|
rigth: 0,
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- events: ['click'],
|
|
|
|
|
|
+ tooltips: {
|
|
|
|
+ callbacks: {
|
|
|
|
+ label: function(tooltipItem, data) {
|
|
|
|
+ var label = data.datasets[tooltipItem.datasetIndex].label || '';
|
|
|
|
+
|
|
|
|
+ if (label) {
|
|
|
|
+ label += ': ';
|
|
|
|
+ }
|
|
|
|
+ label += accounting.formatMoney(tooltipItem.xLabel, CurrencyBase.symbol, CurrencyBase.decimal_places, CurrencyBase.thousands_separator, CurrencyBase.decimal_separator);
|
|
|
|
+ return label;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
});
|
|
});
|
|
},
|
|
},
|