[英]chart.js v2 - how to 'fill' the graph when using time scale
我用chart.js v2创建了一个图表,并且我有一个很好的使用时间刻度轴的工作图。 现在,我想在轴上显示整个小时数,因此我将选项设置为:
xAxes: [{
type: 'time',
time: {
unit: 'hour',
unitStepSize: 1,
displayFormats: { 'hour': 'H:mm' }
}
}]
Codepen: http ://codepen.io/WilbertE/pen/wzRmWr
您要使用time
属性的min
和max
属性:
options: {
scales: {
xAxes: [{
type: "time",
time: {
min: /* Set your min here .. */,
max: /* .. and your max here*/
}
}]
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.