|
|
@@ -996,6 +996,7 @@
|
|
|
|
|
|
const participantData = courseData.datasets.find(d => d.participantData)?.participantData || [];
|
|
|
const suspendedData = courseData.datasets.find(d => d.suspendedData)?.suspendedData || [];
|
|
|
+ const monthNamesExtended = courseData.datasets.find(d => d.monthNamesExtended)?.monthNamesExtended || [];
|
|
|
|
|
|
const ctx = canvasElement.getContext('2d');
|
|
|
|
|
|
@@ -1031,6 +1032,7 @@
|
|
|
order: 1,
|
|
|
participantData: participantData,
|
|
|
suspendedData: suspendedData,
|
|
|
+ monthNamesExtended: monthNamesExtended,
|
|
|
},
|
|
|
{
|
|
|
label: 'TOT. DA INCASSARE',
|
|
|
@@ -1052,6 +1054,7 @@
|
|
|
order: 2,
|
|
|
participantData: participantData,
|
|
|
suspendedData: suspendedData,
|
|
|
+ monthNamesExtended: monthNamesExtended,
|
|
|
}
|
|
|
]
|
|
|
},
|
|
|
@@ -1134,20 +1137,20 @@
|
|
|
titleColor: '#111827',
|
|
|
bodyFont: {
|
|
|
size: 14,
|
|
|
- weight: 'bold',
|
|
|
+ weight: '400',
|
|
|
},
|
|
|
bodyColor: '#111827',
|
|
|
footerFont: {
|
|
|
size: 14,
|
|
|
- weight: 'bold',
|
|
|
+ weight: '400',
|
|
|
},
|
|
|
- footerColor: '#0C6197',
|
|
|
+ // footerColor: '#0C6197',
|
|
|
footerSpacing: 0,
|
|
|
footerMarginTop: 0,
|
|
|
padding: 16,
|
|
|
boxPadding: 8,
|
|
|
usePointStyle: true,
|
|
|
- displayColors: false,
|
|
|
+ displayColors: true,
|
|
|
callbacks: {
|
|
|
title: function (tooltipItems) {
|
|
|
let sum = 0;
|
|
|
@@ -1156,23 +1159,28 @@
|
|
|
sum += tooltipItem.parsed.y;
|
|
|
});
|
|
|
|
|
|
- return tooltipItems[0].label + '\n' + 'TOTALE ATTESO: €' + new Intl.NumberFormat('it-IT').format(sum);
|
|
|
- },
|
|
|
- labelTextColor: function(tooltipItems) {
|
|
|
- return tooltipItems.dataset.backgroundColor;
|
|
|
+ let item = tooltipItems[0];
|
|
|
+ let index = item.dataIndex;
|
|
|
+ let monthNameExtended = item.dataset["monthNamesExtended"] ? item.dataset["monthNamesExtended"][index] : 0;
|
|
|
+
|
|
|
+ // return item.label + '\n' + 'TOTALE ATTESO: €' + new Intl.NumberFormat('it-IT').format(sum);
|
|
|
+ return monthNameExtended + '\n' + 'TOTALE ATTESO: €' + new Intl.NumberFormat('it-IT').format(sum);
|
|
|
},
|
|
|
+ // labelTextColor: function(tooltipItems) {
|
|
|
+ // return tooltipItems.dataset.backgroundColor;
|
|
|
+ // },
|
|
|
label: function (tooltipItems) {
|
|
|
let label = tooltipItems.dataset.label + ': €' + new Intl.NumberFormat('it-IT').format(tooltipItems.parsed.y);
|
|
|
|
|
|
return label;
|
|
|
},
|
|
|
- footer: function (tooltipItems) {
|
|
|
- let item = tooltipItems[0];
|
|
|
- let index = item.dataIndex;
|
|
|
- let suspendedData = item.dataset["suspendedData"] ? item.dataset["suspendedData"][index] : 0;
|
|
|
+ // footer: function (tooltipItems) {
|
|
|
+ // let item = tooltipItems[0];
|
|
|
+ // let index = item.dataIndex;
|
|
|
+ // let suspendedData = item.dataset["suspendedData"] ? item.dataset["suspendedData"][index] : 0;
|
|
|
|
|
|
- return "TOTALE SOSPESI: " + suspendedData;
|
|
|
- }
|
|
|
+ // return "TOTALE SOSPESI: " + suspendedData;
|
|
|
+ // }
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
@@ -1211,7 +1219,7 @@
|
|
|
let tableHtml = `<div class="course-table">
|
|
|
<div class="table-header">
|
|
|
<div class="table-cell month">MESE</div>
|
|
|
- <div class="table-cell percentage">%</div>
|
|
|
+ <div class="table-cell percentage">%<br/>INCASSATO</div>
|
|
|
<div class="table-cell delta">TOT. DA INCASSARE</div>
|
|
|
<div class="table-cell suspended">SOSPESI</div>
|
|
|
</div>`;
|