[英]How to fit Y axis in c3
我想使用旋轉軸,並且要適合Y軸。 我怎樣才能做到這一點?
我試過了 :
c3.generate({
data: {
x: 'x',
columns: [
['x', '2013-10-31', '2013-12-31', '2014-01-31', '2014-02-28'],
['sample', 30, 100, 400, 150],
]
},
axis : {
rotated: true,
x : {
type : 'timeseries',
tick: {
fit: true,
format: "%e %b %y"
}
},
y: {
tick: {
fit: true
}
}
}
但沒有任何變化。 有什么幫助嗎? 我使用c3的0.4.10版本。
不太了解您想做什么,但是
rotated: true
似乎在做應該做的事情,即交換x和y軸。 (提琴-http: //jsfiddle.net/g93c77Lu/ )
fit對於y軸不是有效的選項,因此實際上沒有任何作用。
x軸擬合( http://c3js.org/reference.html#axis-x-tick-fit )也可以完成預期的工作(刻度是根據數據點而定)-只需在其中將true更改為false小提琴以了解不適合的情況。
注意-如果您正在考慮交換數據數組,則y類型還不可用( http://c3js.org/reference.html#axis-y-type )。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.