JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.1.4/Chart.bundle.min.js"></script>
<canvas id="myChart" width="300" height="200"></canvas>
JavaScript
var ctx = document.getElementById("myChart");
var myChart = new Chart(ctx, {
type: 'line',
data: {
labels: ["Red"],
datasets: [{
label: '# of Votes',
data: [12],
backgroundColor: 'rgba(255, 99, 132, 0.2)',
borderColor: 'rgba(255,99,132,1)',
borderWidth: 1
},{
label: 'A',
backgroundColor: 'rgba(90,195,208,0.3)',
borderColor: '#5ac3d0',
data: [10]
}]
},
options: {
hover: {
// Overrides the global setting
mode: 'single'
},
scales: {
yAxes: [{
ticks: {
beginAtZero:true
}
}]
}
}
});