<div clsss="graph">
<canvas id="chart-sample"></canvas>
</div>
const myChart = new Chart(
document.getElementById( 'chart-sample' ),
{
type: 'bar',
data: {
labels: [
'1月',
'2月',
'3月',
'4月',
'5月',
'6月'
],
datasets: [
{
label: '売上',
data: [
120,
80,
97,
105,
94,
110
],
backgroundColor: '#E1BEE7'
}
],
},
options: {
plugins: {
tooltip: {
enabled: false
},
datalabels: {
font: {
size: 13
},
formatter: function( value, context ) {
return value.toString() + '万円';
}
}
}
},
plugins: [
ChartDataLabels,
],
}
);
This Pen doesn't use any external CSS resources.