NVD3 Scatter Chart Circle Radius

醉酒当歌 提交于 2019-11-29 08:02:05

Call .sizeRange([minArea, maxArea]) on your chart object. Note that "size" is proportional to area, not radius, so you need to use the square of the maximum/minimum radius (adjusted by pi/2 if you want to be precise).

As of 1.7.1, call .pointRange([minArea,maxArea]) .

nv.addGraph(function() {
  var chart = nv.models.scatterChart()
                .showDistX(true)
             .sizeRange([1000, 100]) /*****Chart Circle Range******/
                .showDistY(true)
                .color(d3.scale.category10().range());


  chart.xAxis.tickFormat(d3.format('.02f'));
  chart.yAxis.tickFormat(d3.format('.02f'));

  d3.select('#chart svg')
      .datum(data(4,40))
    .transition().duration(500)
      .call(chart);

  nv.utils.windowResize(chart.update);

  return chart;
});

Use this this link or apply the above code into this LINK

.sizeRange([minArea, maxArea])

example: .sizeRange([1000, 100])

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!