I have the below chart using chart.js 3.x.
https://jsfiddle.net/7oxmesnj/1/
I have below chart configuration:
var options = {
type: 'scatter',
data: {
labels: ["Red", "Blue", "Yellow", "Green", "Purple", "Orange"],
datasets: [
{
label: '# of Votes',
data: [12, 19, 3, 5, 2, 3],
borderWidth: 0,
showLine: true,
},
{
label: '# of Points',
data: [7, 11, 5, 8, 3, 7],
borderWidth: 0,
showLine: true,
}
]
},
options: {
scales: {
y:{
type: 'linear',
min: 0,
max: 500,
ticks: {
stepSize: 100,
reverse: false
}
},
x:{
type: 'linear',
min: 0,
max: 500,
ticks: {
stepSize: 100,
reverse: false
}
}
}
}
}
I am not able to plot the data on the scatter chart.
I have followed the migration guild, but still no data on chart.
https://www.chartjs.org/docs/master/getting-started/v3-migration
You should change datasets to have pairs of numbers (x, y). See documentation.