0๐
โ
I just add these lines to head and solve my problem:
<link rel="stylesheet" href="ckeditor/plugins/chart/lib/chart.css">
<script src="ckeditor/plugins/chart/chart.min.js"></script>
<script src="ckeditor/plugins/chart/widget2chart.js"></script>
1๐
You can use canvas
for your chart container
<canvas id="chartjs" width='300' height='300'></canvas>
And then run this javascript, passing your parameters as follows:
var ctx = document.getElementById("chartjs");
var myChart = new Chart(ctx, {
type: 'doughnut',
data: {
labels: ["A", "B"],
datasets: [{
data: [70, 50],
backgroundColor: ['red', 'pink']
}]
},
});
Source:stackexchange.com