2016-02-04 102 views
3

我創建使用改性點氣泡圖:C3.js氣泡圖表選擇

var chart = c3.generate({ 
point: { 
    r: 80, 
    focus: { 
     expand: { 
      enabled: false 
     } 
    }, 
}, 
data: { 
    columns: [ 
     ["data", 1.4, 2.5, 1.5], 
    ], 
type: 'scatter' 
}, 
}); 

但是,當我想選擇氣泡,我需要指向氣泡的中心。我如何執行整個泡沫的選擇?

回答

3

還有爲point圖表,允許您設置點的靈敏度(這應該是相同的半徑值無證功能:

var chart = c3.generate({ 
 
    point: { 
 
    r: 100, 
 
    sensitivity: 100, // This is the key here. 
 
    focus: { 
 
     expand: { 
 
     enabled: false 
 
     } 
 
    }, 
 
    }, 
 
    data: { 
 
    columns: [ 
 
     ["data", 1.4, 2.5, 1.5], 
 
    ], 
 
    type: 'scatter' 
 
    } 
 
});
<link href="https://cdn.rawgit.com/c3js/c3/0.4.11/c3.css" rel="stylesheet" /> 
 
<script src="https://cdn.rawgit.com/c3js/c3/0.4.11/c3.js"></script> 
 
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.4.11/d3.min.js"></script> 
 

 
<div id="chart"></div>

TBTH靈敏度值應可能與默認的半徑相同。原樣。