我制作了一个条形图,它还有一个子图。我想将子图的类型更改为线。就像这样,主图表应该是条形图,但它的子图表应该是折线图。
这是我用来生成图表的代码片段。但是子图的类型不起作用。
var chart=c3.generate({
bindto:bindTo(),
data:{
x:'x',
/* value:['Percent DEP Enabled'],*/
columns:data(),
type: 'bar'
},
subchart: {
show: true,
size: {
height: 25
},
},
axis: {
x: {
type: 'timeseries',
tick: {
format: '%m-%d-%y',
rotate: -45,
},
height: 75
},/* y: {
tick: {
values: function(){
jQuery.forEach(function(){
})}
count: 8,
format:d3.format(".2s"),
},
},*/
subchart: {
show: true,
type: 'line',
}
}
});
最佳答案
你不能这样做,因为没有像 axis.subchart
这样的设置。当你看一下 reference您会找到所需的一切,但您别无选择。
关于javascript - 有没有办法改变 c3.js 中子图的类型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35871510/