当尝试将json数据映射到c3 js中的多个y轴时,第二个轴不会缩放到数据,而是显示0-1。有任何改变它的想法吗?
答案 0 :(得分:1)
var chart = c3.generate({
bindto: '#chart',
data: {
json: [{
"name": "google search",
"Lead": 250,
"Conversion": 59,
"Rate": 50
},
{
"name": "facebook advertisement",
"Lead": 104,
"Conversion": 20,
"Rate": 60
},
{
"name": "ST Ads",
"Lead": 200,
"Conversion": 123,
"Rate": 70
}
],
keys: {
x: 'name',
value: ['Lead', 'Conversion', 'Rate'],
},
axes: {
'Rate': 'y2'
},
type: 'bar',
types: {
'Rate': 'line'
}
},
axis: {
x: {
type: 'category'
},
y2: {
show: true
}
}
});