chart = c3.generate({
bindto: "#yearly",
data: {
x: 'x',
columns: [
[x,1,2,.....,100],
[data1,10,20.....,30],
[data2,15,16,......,90],
.
.
.
[data50,20,30,......,80]
]
}
});
在我的工具提示中显示1到50行,但我想将它们分成10行的colomns
喜欢-
data1 - 10 |数据11-10
. |.
. |.
data10 -20 | data20 - 50
尝试使用回调函数覆盖工具提示内容,
tooltip: {
contents: function (d, defaultTitleFormat, defaultValueFormat, color) {
// Inspect d and see how the data coming
// Assuming d.data is the array you are talking about
var data="";
for(i=0;i<49;i=i+10)
{
for(j=i;j<j+10:j++)
data+=" "+j
}
if(i!=49)
data=+" | "
}
return data // you can use formatted html as well
}