va
This commit is contained in:
parent
ebed25687a
commit
4e78d73609
|
|
@ -561,7 +561,7 @@
|
||||||
data: {
|
data: {
|
||||||
labels: dataConso.garanties,
|
labels: dataConso.garanties,
|
||||||
datasets: [{
|
datasets: [{
|
||||||
label: 'Dépenses',
|
label: '<?= _('Dépenses')?>',
|
||||||
data: dataConso.depenses,
|
data: dataConso.depenses,
|
||||||
backgroundColor: 'rgba(54, 162, 235, 0.7)',
|
backgroundColor: 'rgba(54, 162, 235, 0.7)',
|
||||||
borderColor: 'rgba(54, 162, 235, 1)',
|
borderColor: 'rgba(54, 162, 235, 1)',
|
||||||
|
|
@ -598,13 +598,13 @@
|
||||||
callbacks: {
|
callbacks: {
|
||||||
label: function(context) {
|
label: function(context) {
|
||||||
const plafond = dataConso.plafonds[context.dataIndex];
|
const plafond = dataConso.plafonds[context.dataIndex];
|
||||||
let tooltip = `Dépenses: ${formatMoney(context.parsed.y)}`;
|
let tooltip = `<?= _('Dépenses').':'?> ${formatMoney(context.parsed.y)}`;
|
||||||
|
|
||||||
if (plafond !== null) {
|
if (plafond !== null) {
|
||||||
const pourcentage = Math.min(100, Math.round((context.parsed.y / plafond) * 100));
|
const pourcentage = Math.min(100, Math.round((context.parsed.y / plafond) * 100));
|
||||||
tooltip += ` (${pourcentage}% du plafond)`;
|
tooltip += ` (${pourcentage}% <?= _('du plafond')?>)`;
|
||||||
} else {
|
} else {
|
||||||
tooltip += ' (plafond illimité)';
|
tooltip += ' <?= _('(plafond illimité)')?>';
|
||||||
}
|
}
|
||||||
|
|
||||||
return tooltip;
|
return tooltip;
|
||||||
|
|
@ -632,7 +632,7 @@
|
||||||
x: {
|
x: {
|
||||||
title: {
|
title: {
|
||||||
display: true,
|
display: true,
|
||||||
text: 'Garanties',
|
text: '<?= _('Garanties')?>',
|
||||||
font: {
|
font: {
|
||||||
weight: 'bold'
|
weight: 'bold'
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -546,7 +546,7 @@
|
||||||
data: {
|
data: {
|
||||||
labels: dataConso.garanties,
|
labels: dataConso.garanties,
|
||||||
datasets: [{
|
datasets: [{
|
||||||
label: 'Dépenses',
|
label: '<?= _('Dépenses')?>',
|
||||||
data: dataConso.depenses,
|
data: dataConso.depenses,
|
||||||
backgroundColor: 'rgba(54, 162, 235, 0.7)',
|
backgroundColor: 'rgba(54, 162, 235, 0.7)',
|
||||||
borderColor: 'rgba(54, 162, 235, 1)',
|
borderColor: 'rgba(54, 162, 235, 1)',
|
||||||
|
|
@ -569,7 +569,7 @@
|
||||||
borderWidth: 2,
|
borderWidth: 2,
|
||||||
borderDash: [6, 6],
|
borderDash: [6, 6],
|
||||||
label: {
|
label: {
|
||||||
content: `Plafond: ${formatMoney(plafond)}`,
|
content: `<?= _('Plafond')?>: ${formatMoney(plafond)}`,
|
||||||
enabled: true,
|
enabled: true,
|
||||||
position: 'right'
|
position: 'right'
|
||||||
}
|
}
|
||||||
|
|
@ -583,13 +583,13 @@
|
||||||
callbacks: {
|
callbacks: {
|
||||||
label: function(context) {
|
label: function(context) {
|
||||||
const plafond = dataConso.plafonds[context.dataIndex];
|
const plafond = dataConso.plafonds[context.dataIndex];
|
||||||
let tooltip = `Dépenses: ${formatMoney(context.parsed.y)}`;
|
let tooltip = `<?= _('Dépenses')?>: ${formatMoney(context.parsed.y)}`;
|
||||||
|
|
||||||
if (plafond !== null) {
|
if (plafond !== null) {
|
||||||
const pourcentage = Math.min(100, Math.round((context.parsed.y / plafond) * 100));
|
const pourcentage = Math.min(100, Math.round((context.parsed.y / plafond) * 100));
|
||||||
tooltip += ` (${pourcentage}% du plafond)`;
|
tooltip += ` (${pourcentage}% du plafond)`;
|
||||||
} else {
|
} else {
|
||||||
tooltip += ' (plafond illimité)';
|
tooltip += ' <?= _('(plafond illimité)')?>';
|
||||||
}
|
}
|
||||||
|
|
||||||
return tooltip;
|
return tooltip;
|
||||||
|
|
@ -602,7 +602,7 @@
|
||||||
beginAtZero: true,
|
beginAtZero: true,
|
||||||
title: {
|
title: {
|
||||||
display: true,
|
display: true,
|
||||||
text: `Montant des dépenses`,
|
text: '<?= _("Montant des dépenses") ?>',
|
||||||
font: {
|
font: {
|
||||||
weight: 'bold'
|
weight: 'bold'
|
||||||
}
|
}
|
||||||
|
|
@ -617,7 +617,7 @@
|
||||||
x: {
|
x: {
|
||||||
title: {
|
title: {
|
||||||
display: true,
|
display: true,
|
||||||
text: 'Garanties',
|
text: '<?= _('Garanties')?>',
|
||||||
font: {
|
font: {
|
||||||
weight: 'bold'
|
weight: 'bold'
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user