Ste*_*ich 7 javascript chart.js
如何设置最小值和最大值xAxes?它工作正常,yAxes但xAxes它没有表现出任何行为.
我xAxes正在使用type: 'time'.我的标签xAxis也在使用该moment对象.但是当我删除类型时间并使用普通数字时它也不起作用.我使用Chart.js版本2.2.2.
scales: {
yAxes: [{
ticks: {
beginAtZero:false,
}
}],
xAxes: [{
type: 'time',
ticks: {
min: moment(1471174953000),
max: moment(1473853353000)
}
}]
}
Run Code Online (Sandbox Code Playgroud)
tek*_*tiv 18
您要查找的time属性实际上在属性中:
options: {
scales: {
xAxes: [{
type: "time",
time: {
min: 1471174953000,
max: 1473853353000
}
}]
}
}
Run Code Online (Sandbox Code Playgroud)
小智 6
这在3.0中被改变了
https://www.chartjs.org/docs/latest/getting-started/v3-migration.html#options
scales.[x/y]Axes.time.max was renamed to scales[id].max
scales.[x/y]Axes.time.min was renamed to scales[id].min
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
8816 次 |
| 最近记录: |