i have chart.js like this :
const options = {
type: 'bar',
data: {
labels: ["Smartphone", "Trahsphone"],
datasets: [{
label: '# of Votes',
data: [4, 4],
backgroundColor: [
'rgba(255, 99, 132, 0.9)',
'rgba(54, 162, 235, 0.7)',
]
}]
},
options: {
scales: {
yAxes: [{
ticks: {
min: 0,
max: 10,
stepSize: 1
}
}]
}
}
}
const ctx = document.getElementById('chartJSContainer').getContext('2d');
new Chart(ctx, options);
<body>
<canvas id="chartJSContainer" width="600" height="400"></canvas>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.8.0/Chart.js"></script>
</body>
i want to find out, how to adding label on my chart, so the data which means 4 on smartphone, and 4 on Trahsphone are appear without we click it first.
so expected result would be like this