我使用 chart.js 3.x 有下面的图表。
https://jsfiddle.net/7oxmesnj/1/
我有以下图表配置:
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
}
}
}
}
}
我无法在散点图上绘制数据。
我已经关注了迁移公会,但图表上仍然没有数据。
https://www.chartjs.org/docs/master/getting-started/v3-migration