Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bubble chart min radius #687

Closed
Madlios opened this issue Aug 27, 2014 · 4 comments
Closed

Bubble chart min radius #687

Madlios opened this issue Aug 27, 2014 · 4 comments

Comments

@Madlios
Copy link

Madlios commented Aug 27, 2014

Hi,

Recently when i render my bubble chart, it seems like i cannot set he radius to below 10 no matter what i do, i want to be able to set min radius to as small as 1 screen pixel if possible.
I cannot seem to find any API to do this. So i'm wondering if this is a bug.

@Mepherotus
Copy link

I can confirm this issue with the master api.
This creates a strange behavior, if you set a relative max bubble size than only the bubbles with the rendered size above the max size are reduced in size so you have bubbles with a few points far bigger than the bubbles that should be the biggest ones.

@Mepherotus
Copy link

dc.bubbleMixin = function (_chart) {
 var _maxBubbleRelativeSize = 0.3;
 var _minRadiusWithLabel = 10;
 _chart.BUBBLE_NODE_CLASS = 'node';
 _chart.BUBBLE_CLASS = 'bubble';
 _chart.MIN_RADIUS = 10;
 ............
};

try setting
YourChart.MIN_RADIUS = 1;

@gordonwoodhull
Copy link
Contributor

Sounds like there are two bugs here. I had run into the MIN_RADIUS problem before. I think we should add a getter/setter for this, so that it is part of the documented interface.

@Mepherotus, could you elaborate on the max bubble size problem, preferably in a separate issue? The code in both bubbleChart and bubbleOverlay contains the following line:

     _chart.r().range([_chart.MIN_RADIUS, _chart.xAxisLength() * _chart.maxBubbleRelativeSize()]);

Since the radius scale is a linear scale with domain [0,100], you should get a smooth progression from MIN_RADIUS to _chart.xAxisLength() * _chart.maxBubbleRelativeSize() - at least, as long as your domain is actually [0,100]. (Whose is?)

The scale isn't clamped, so if your values go larger than 100, you'll get sizes outside the range. (It's not actually a maximum, it's just what 100 maps to.) But you should never see a bubble with a smaller value get a larger radius, if that's what you mean.

@gordonwoodhull gordonwoodhull added this to the v2.0 milestone Nov 30, 2014
@Mepherotus
Copy link

It's really strange, now I can't recreate the issue, maybe it was just a bad dream =D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants