Update Chart.js and change style for a more fitting one

This commit is contained in:
2022-08-09 23:35:46 +02:00
parent 302f51dcb3
commit 9ca53a4176
7 changed files with 221 additions and 151 deletions

View File

@ -50,6 +50,9 @@ jQuery(document).ready(function($)
gatherYear(tens, 2010, 2020);
}
Chart.defaults.font.family = "'Rubik', Helvetica";
Chart.defaults.color = "#000000";
var canvasPhoto = document.getElementById("photo").getContext('2d');
var chartPhoto = new Chart(canvasPhoto, {
type: 'bar',
@ -83,40 +86,60 @@ jQuery(document).ready(function($)
}]
},
options: {
tooltips: {
mode: 'index',
intersect: false
plugins: {
tooltip: {
mode: 'index',
intersect: false,
titleFont: {
size: 14
},
bodyFont: {
size: 14
},
},
legend: {
display: false,
position: "bottom",
},
},
responsive: true,
scales: {
yAxes: [{
y: {
ticks: {
font: {
size: 14
},
beginAtZero: true
}, gridLines: {
display: true
},
scaleLabel: {
grid: {
lineWidth: 0
},
title: {
display: true,
labelString: 'Tableaux'
text: 'Tableaux',
font: {
size: 16
}
},
stacked: true,
}],
xAxes: [{
gridLines: {
display: false
},
x: {
ticks: {
font: {
size: 14
},
},
grid: {
lineWidth: 0
},
stacked: true,
}]
},
legend: {
display: false,
position: "bottom",
},
},
animation: {
duration: 0
},
responsiveAnimationDuration: 0
}
responsiveAnimationDuration: 0,
},
});
});
});