chartjs xAxis和Label关系

时间:2019-12-09 16:18:12

标签: label chart.js coordinates

这是我的chartjs折线图:enter image description here

要绘制它,我使用了代码:

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的值不同?

0 个答案:

没有答案