Optimized chart code.

This commit is contained in:
James Cole
2016-11-16 20:35:25 +01:00
parent cb02e0ee71
commit 4ef324cf24
20 changed files with 191 additions and 405 deletions

View File

@@ -0,0 +1,46 @@
var defaultChartOptions = {
scales: {
xAxes: [
{
gridLines: {
display: false
}
}
],
yAxes: [{
display: true,
ticks: {
callback: function (tickValue, index, ticks) {
"use strict";
return accounting.formatMoney(tickValue);
},
beginAtZero: true
}
}]
},
tooltips: {
mode: 'label',
callbacks: {
label: function (tooltipItem, data) {
"use strict";
return data.datasets[tooltipItem.datasetIndex].label + ': ' + accounting.formatMoney(tooltipItem.yLabel);
}
}
}
};
var defaultPieOptions = {
tooltips: {
callbacks: {
label: function (tooltipItem, data) {
"use strict";
var value = data.datasets[0].data[tooltipItem.index];
return data.labels[tooltipItem.index] + ': ' + accounting.formatMoney(value);
}
}
},
maintainAspectRatio: true,
responsive: true
};