我正在尝试使用对数刻度而不是线性刻度,我的代码是:
html
<line-chart :data="datafor"></line-chart>
JS
datafor = {
name: "Test name",
data: objectHere,
library: {
legend: {
position: "bottom"
},
scales: {
yAxes: [
{
id: "y-axis",
type: "logarithmic"
}
]
}
}
};
}
上面的代码仍然只是给我一个线性比例线图,有什么想法吗?
我通过执行以下操作修复了它:
html:
<line-chart :library="chartOption":data="datafor"></line-chart>
js
chartOption = { legend: { position: "top" }, scales: { yAxes: [ { id: "y-axis", type: "logarithmic" } ] } }; datafor[i] = { name: "Test name", data: objectHere, title: "test" }; }