javascript - 如何在X轴上设置比例?
问题描述
我尝试制作一些图表电池,但我在时间间隔方面遇到了一些问题。我有一些这样的代码
var ctx = document.getElementById('myChart').getContext('2d');
var chart = new Chart(ctx, {
// The type of chart we want to create
type: 'line',
// The data for our dataset
data: {
labels: ["2018-04-26 00:10:00", "2018-04-26 00:15:00", "2018-04-26 01:10:00", "2018-04-26 01:40:00", "2018-04-26 01:5:00", "2018-04-26 01:55:00", "2018-04-26 02:10:00"],
datasets: [{
label: "My First dataset",
data: [11.2, 11.6, 12.1, 12.1, 12.2, 12.4, 12.4],
}]
},
// Configuration options go here
options: {}
});
我不知道如何设置间隔 30 分钟。如果有人有什么想法?
谢谢。
解决方案
推荐阅读
- oracle-sqldeveloper - 使用 WHERE 子句从同一个主表创建两个不同的列
- csvhelper - 编写类似于 CSV 文件的文件
- c - if 语句和 mod(SIZE) 之间的效率差异
- regex - 正则表达式:捕获任何(动态)数量的行
- php - 在 Google Cloud 的 centos 上运行的 Code Igniter 上的内部服务器错误 500
- python - Python:为什么返回语句不起作用?
- python - 直接处理没有Button的Tkinter Entry输入?
- hadoop - Hadoop:纱线和本地内存使用
- python - tensorflow 训练第一个 epoch 结束时的 ValueError
- firebase - Flutter/Firestore - 带有实时监听器的 Streambuilder 和 Firestore