diff options
Diffstat (limited to 'admin/survey/script/Chartjs.js')
-rw-r--r-- | admin/survey/script/Chartjs.js | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/admin/survey/script/Chartjs.js b/admin/survey/script/Chartjs.js new file mode 100644 index 0000000..d968d2f --- /dev/null +++ b/admin/survey/script/Chartjs.js @@ -0,0 +1,28 @@ +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: 30, //slice width
+ }
+ };
+
+ const myChart = new Chart(
+ document.getElementById(place),
+ config
+ );
+
+}
\ No newline at end of file |