d3.v3 scatterplot with all circles the same radius

后端 未结 2 717
一向
一向 2021-01-03 13:20

Every example I have found shows all of the scatter plot points to be of random radii. Is it possible to have them all the same size? If I try to statically set the radius a

2条回答
  •  时光取名叫无心
    2021-01-03 14:07

    The radius is measured in pixels. If you set it to a value less than one, yes, you will have a very small circle. Most of the examples that use random numbers also use a scaling factor.

    If you want all the circles to have a constant radius you don't need to set the value in the data, just set it when you add the radius attribute.

    Not sure which tutorials you were looking at, but start here: https://github.com/mbostock/d3/wiki/Tutorials

    The example "Three little circles" does a good step-by-step of the different things you can do with circles: http://mbostock.github.io/d3/tutorial/circle.html

提交回复
热议问题