有没有办法使用类似于 Plottable.js 的解决方案的 Plotly.js 创建时间轴?
这里的例子。
我计划迁移到 Plotly.js,但我真的爱上了时间轴的这种演示,因为我必须绘制很多时间序列,所以用 plotly 实现类似的东西会很棒。
我找不到如何在 plotly.js 中绘制多层时间轴。但这是一种解决方法。
如下设置您的布局。
xaxis: {
showline: true,
showgrid: true,
showticklabels: true,
type : 'category', //this will allow set 'tickson '
tickson : 'boundaries', //this will show lable in middle.
ticklen : 22, //this will show line as grid
linecolor: 'rgb(204,204,204)',
linewidth: 2,
autotick: false,
ticks: 'outside',
tickcolor: 'rgb(204,204,204)',
tickwidth: 1,
tickfont: {
family: 'Arial',
size: 12,
color: 'rgb(82, 82, 82)'
}
},
这是给你的演示。代码笔
