NVD3 Pie Scatter Radius

I was wondering how I can set the minimum and maximum circle radii in the NVD3 scatter plot.

Scattering NVD3: http://nvd3.org/ghpages/scatter.html

+3
source share
3 answers

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

+7
source

Starting from 1.7.1 call .pointRange([minArea,maxArea]).

+4
source
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;
});

.sizeRange([minArea, maxArea])

:.sizeRange([1000, 100])

+2

All Articles