Hi all,
I'm trying to create a graph as a feedback to my participants (what won't I do for their data...) but my code gives an error message (for phase 3), can anyone help me with this?
Phase 1 - Header HTML code
Phase 2 - HTML code for creating a space for the chart
Phase 3 - graph data
var ctx = document.getElementById("myChart").getContext('2d');
var myChart = new Chart(ctx, {
type: 'bar',
data: {
labels: ["a", "b", "c", "d", "e"],
datasets: [{
label: 'example',
data: ["1","2","3","4", "5"],
backgroundColor: [
'rgba(255, 99, 132, 0.2)',
'rgba(54, 162, 235, 0.2)',
'rgba(255, 206, 86, 0.2)',
'rgba(75, 192, 192, 0.2)’,
'rgba(255, 159, 64, 0.2)'
],
borderColor: [
'rgba(255,99,132,1)',
'rgba(54, 162, 235, 1)',
'rgba(255, 206, 86, 1)',
'rgba(75, 192, 192, 1)’,
'rgba(255, 159, 64, 1)'
],
borderWidth: 1
}]
},
options: {
scales: {
yAxes: [{
ticks: {
max: 7,
min: 0,
beginAtZero:true
}
}]
}
}
});
The error message I get is: Invalid JavaScript! You cannot save until you fix all errors: Unexpected token ILLEGAL
Can anyone help?
Have a good weekend!
Daniel
Best answer by TSAcc
View original