要绘制它,我使用了代码:
var preOptimization = new Chart(ctx, {
type: 'line',
data: {
labels: ["00:39", "Line 17 Verga Tozzi - Boito", "01:03", "Line 23 - Croce A Varliano - T2 Guidoni", "01:05", "Line 35 - Leopolda Porta Al Prato - Indicatore - L…e 30 - Leopolda Porta Al Prato - Piazza Togliatti"],
datasets: [{
borderColor: "red",
borderDash: null,
data: [{x: "00:39", y: 500},{x: "Line 17 Verga Tozzi - Boito", y: 0}],
fill: "false"
},{
borderColor: "blue",
borderDash:[10, 5],
data: [{x: "01:03", y: 0},{x: "Line 23 - Croce A Varliano - T2 Guidoni", y: -500}],
fill: "false"
},{
borderColor: "blue",
borderDash: [10, 5],
data:[{x: "01:05", y: 0},{x: "Line 35 - Leopolda Porta Al Prato - Indicatore - L…e 30 - Leopolda Porta Al Prato - Piazza Togliatti", y: -500}],
fill: "false"
}]
},
options: {
legend: {
display: false
},
responsive: true,
title: {
display: true,
text: title,
fontSize: 32
},
scales: {
yAxes: [{
display: false
}
]
}
}
});
我观察到标签标签和x坐标之间存在关系。
是否可以解除绑定关系,并且标签和xs的值不同?