NVD3 Scatter Chart Circle Radius

匿名 (未验证) 提交于 2019-12-03 02:01:02

问题:

I was wondering how I can set minimum and maximum radii of the circles in an NVD3 scatter chart.

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

回答1:

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).



回答2:

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



回答3:

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])



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