Dear community,
The following script from https://www.chartjs.org/docs/latest/getting-started/ does not seem to be working in my survey. I am very new to Java and HTML and was hoping you could you help me figure out why it's not working. Thank you very much for your help!
In the question itself, I have included the following code in HTML:
<div><canvas id="myChart"></canvas></div>
I have added the following code the the header in HTML:
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
To the question JSS, I have included the following code:
const ctx = document.getElementById('myChart');
new Chart(ctx, {
type: 'bar',
data: {
labels: 'Red', 'Blue', 'Yellow', 'Green', 'Purple', 'Orange'],
datasets: {
label: '# of Votes',
data: <12, 19, 3, 5, 2, 3],
borderWidth: 1
}]
},
options: {
scales: {
y: {
beginAtZero: true
}
}
}
});