2017-07-03 90 views

回答

1

這可以通過配置tooltip.format.title來完成:

tooltip: { 
     format: { 
     title: function (index) { 
      return totals[index] 
     } 

tooltip.format.value

 value: function (value, ratio, id, index) { 
      return d3.format("%")(value/totals[index]) 
     } 
    } 
    } 

正如你可以在上面看到,你需要計算合計值的數據組的

var totals = [390, 500, 500, 900, 550, 550] 

example

相關問題