jQuery addClass example
Change class name on click in jQuery
by jeffgw
HTML
<script src="http://www.chartjs.org/dist/2.7.2/Chart.bundle.js"></script>
<script src="http://www.chartjs.org/samples/latest/utils.js"></script>
<div>
<canvas id="canvas" style="height:150px; width:150px"></canvas>
</div>
CSS
canvas {
-moz-user-select: none;
-webkit-user-select: none;
-ms-user-select: none;
}
JavaScript
// Slider to control time
var color = Chart.helpers.color;
var config = {
type: 'radar',
data: {
labels: ['99211','99212','99213','99214','99215'],
datasets: [{
label: 'DOE, JANE E',
backgroundColor: color(window.chartColors.black).alpha(0.7).rgbString(),
borderColor: window.chartColors.black,
pointBackgroundColor: window.chartColors.black,
data: [10,30,20,5,5]
}, {
label: 'MGMA Targets',
backgroundColor: color(window.chartColors.blue).alpha(0.5).rgbString(),
borderColor: window.chartColors.blue,
pointBackgroundColor: window.chartColors.blue,
data: [0,14,62,24,1]
}, {
label: 'AMC MADIGAN-LEWIS',
backgroundColor: color(window.chartColors.yellow).alpha(0.5).rgbString(),
borderColor: window.chartColors.yellow,
pointBackgroundColor: window.chartColors.yellow,
data: [0,20,52,34,1]
}]
},
options: {
legend: {
position: 'bottom',
},
title: {
display: true,
text: 'Established Patient'
},
scale: {
ticks: {
beginAtZero: true
}
}
}
};
window.myRadar = new Chart(document.getElementById('canvas'), config);