0
我正在使用js和chart.js
,我试图标记我的x轴&,无论哪个示例我什么都不尝试,在我的代码中有几个示例 1.更改使用labels
,2,更改使用label
里面的axes
..如何命名我的x和y?如何标记x和y轴 - 在一个线条图
var vtx = document.getElementById("nowChart").getContext("2d");
var myChart = new Chart(vtx, {
type: 'line',
labels: [{ xLabels: "Days" }, {yLabels:"Ways"} ],
data: {
datasets: [{
label: 'IBM graph',
data: mydata,
showLine: true,
pointBackgroundColor: "#00ff11",
pointBorderWidth: 1,
}]
},
options: {
scales: {
xAxes: [{
type: 'linear',
position: 'bottom',
ticks: {
beginAtZero: true
},
label:"Days"
}],
yAxes: [{
type: 'linear',
position: 'left',
stacked: true,
ticks: {
beginAtZero: true
},
label: "Rays"
}]
}
}
});
为我工作,享受 选项= { 秤:{ yAxes:[{ scaleLabel:{ 显示:真实, labelString: '概率' }} ] }} – Damkulul