I have this graph that shows a bar only. How can I put another two bars on the side of this and that it changes its colors depending on whether the data is less than 50 is red and greater than 50 is blue?
var ctx = document.getElementById('chart');
var myChart = new Chart(ctx, {
type: 'bar',
data: {
labels: ['Risk Level'],
datasets: [
{
label: 'Low',
data: [67.8],
backgroundColor: '#D6E9C6',
},
{
label: 'Moderate',
data: [20.7],
backgroundColor: '#FAEBCC',
},
{
label: 'High',
data: [11.4],
backgroundColor: '#EBCCD1',
}
]
},
options: {
scales: {
xAxes: [{ stacked: true }],
yAxes: [{ stacked: true }]
}
}
});
canvas { background-color : #eee;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.3.0/Chart.js"></script>
<body>
<canvas id="chart" width="600" height="400"></canvas>
</body>