我c3.js用于实现仪表板.它工作得很好.但我只想在顶部出现传奇.我想绘制图表作为这个序列.
这是样本图想要什么.
通过在网络中搜索,如果我设置这样的图例配置
legend: {
show: true,
position: 'inset',
inset: {
anchor: 'top-right',
x: 50,
y: 0,
step: 1
}
}
Run Code Online (Sandbox Code Playgroud)
然后图例重叠主图,如下图所示:
使用填充选项设置顶部间隙:http: //c3js.org/reference.html#padding-top
然后在插图上设置负y偏移:
legend: {
position: 'inset',
inset: {
anchor: 'top-right',
x: 50,
y: -30,
step: 1
}
},
padding: {
top: 30
}
Run Code Online (Sandbox Code Playgroud)