NVD3散点图圆半径 [英] NVD3 Scatter Chart Circle Radius

查看:36
本文介绍了NVD3散点图圆半径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道如何在 NVD3 散点图中设置圆圈的最小和最大半径.

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

NVD3 散点:http://nvd3.org/ghpages/scatter.html

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

推荐答案

在您的图表对象上调用 .sizeRange([minArea, maxArea]).请注意,大小"与面积成正比,而不是与半径成正比,因此您需要使用最大/最小半径的平方(如果要精确,则需要调整 pi/2).

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

这篇关于NVD3散点图圆半径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆