chart import
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<div>
<canvas id="chart" ></canvas>
</div>
var data = {
labels: ['1', '2', '3', '4', '5', '6'],
datasets: [{
label: 'xxx',
data: [50, 60, 70, 180, 200, 5],
borderWidth: 1
},
var options = {
responsive: true,
plugins: {
legend: {
position: 'top',
},
title: {
display: true,
text: 'Chart.js Pie Chart'
}
}
};
var barCtx = $('#chart');
var barchart = new Chart(barCtx, {
type: 'bar',
data: data,
options: options
});