作者:喜欢香覀香的树花园 | 来源:互联网 | 2023-01-27 21:03
1> ɢʀᴜɴᴛ..:
??????
xAxisID: 'x2'
为第二个数据集设置,如下所示:
datasets: [{
...
}, {
label: "$Money",
backgroundColor: "rgba(55,99,132,0.2)",
borderColor: "rgba(255,99,132,1)",
borderWidth: 1,
hoverBackgroundColor: "rgba(55,99,132,0.4)",
hoverBorderColor: "rgba(255,99,132,1)",
data: [265, 459, 320, 181, 456, 555, 1040],
xAxisID: 'x2',
}]
??????
设置type: 'linear'
和position: 'bottom'
作为第二个x轴,如下所示:
xAxes: [{
...
}, {
id: 'x2',
type: 'linear',
position: 'bottom',
gridLines: {
display: false
}
}]
??????? ?X??????
datasets: [{
...
}, {
label: "$Money",
backgroundColor: "rgba(55,99,132,0.2)",
borderColor: "rgba(255,99,132,1)",
borderWidth: 1,
hoverBackgroundColor: "rgba(55,99,132,0.4)",
hoverBorderColor: "rgba(255,99,132,1)",
data: [265, 459, 320, 181, 456, 555, 1040],
xAxisID: 'x2',
}]
xAxes: [{
...
}, {
id: 'x2',
type: 'linear',
position: 'bottom',
gridLines: {
display: false
}
}]