如何在每列不同的列10中划分工具提示大数据

问题描述 投票:1回答:1
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

angular6 c3.js
1个回答
0
投票

尝试使用回调函数覆盖工具提示内容,

  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

    }
© www.soinside.com 2019 - 2024. All rights reserved.