编程语言
首页 > 编程语言> > javascript-C3.js气泡图选择

javascript-C3.js气泡图选择

作者:互联网

我使用修改点创建了气泡图:

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

但是当我喜欢选择气泡时,我需要指出气泡的中心.如何执行整个气泡的选择?

解决方法:

点图有一个未记录的功能,可让您设置点灵敏度(应与半径值相同:

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默认情况下,灵敏度值应与半径相同.就这样I’ve created an issue

标签:d3-js,c3-js,javascript
来源: https://codeday.me/bug/20191027/1944066.html