๐:0
HTML Code :
<div id="chartContainer">
<canvas id="jobChart"></canvas>
</div>
JS CODE :
document.getElementById('job-role').addEventListener('change', function() {
$('#jobChart').remove();
$('#chartContainer').append('<canvas id="jobChart"><canvas>');
//Here you need to call generate the graph again then add the values to dataset.
chart.data.datasets = jobDatasets[this.value]
chart.update()
});