1KA_F2F/admin/survey/script/Chartjs.js
tejagerjovic ae33fd6ee8 [Redizajn 1KA v2] - Testiranje --> Diagnostika - v2
Premaknjen source in funkcija za graf v svoj .js file
2022-07-19 10:46:54 +02:00

28 lines
461 B
JavaScript

function diagnosticsChart(place,display) {
const data = {
datasets: [{
data: display,
backgroundColor: [
'rgb(229,229,229)',
'rgb(30, 136, 229)',
],
borderWidth: 0, //spacing between slices
}]
};
const config = {
type: 'doughnut',
data: data,
options: {
events: [], //no hover labels,animations,...
cutout: 32, //slice width
}
};
const myChart = new Chart(
document.getElementById(place),
config
);
}