-
-
Notifications
You must be signed in to change notification settings - Fork 6k
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
Added Bubble Chart Type #25
Conversation
Thank you for this contribution! :-) Please make a PR against the bubble-chart branch, so I can investigate it and make adjustments as necessary... |
OK I've pulled it into a separate branch - will work on it and push to the master when I see that it's ready! |
An update: I'm deleting my branch, waiting to pull this request when it's ready... |
Will try to do this today. I really wish there was an easy way to create new files in Xcode without these comments. |
done ;) |
Just one question - Why did you choose to set a separate property for bubble size? Isn't value always the same as size? |
I can understand your confusion. The difference is that the size is the number of items that belong to the corresponding x and y values while the bubble size is the actual size of the bubble on screen. I could have named size better I guess since it actually represents the weight of that data. Lets say you have data x, y, z where x is the survey questions 1-5, y is the score from 1-5 and z is the number of people that answered. So if there is 2 data points of (1,5,10) and (2,1,100) then what would the graph look like? It should look like a point at (1,5) and a point at (2,1) where the point at (2,1) is 10 times bigger than (1,5). Since there is no z axis you can't say that the size of the bubble will be 10 and 100 because what does that mean (10 and 100 px or something else). The bubble chart is supposed to indicate visually the different weights for the data points. So what I did was consider that the width and height of the chart would be the scale for the bubble. If you take that into consideration making the size 10 px and 100 px would make them very small on the chart. I used bubble size instead so that the data can be represented as big as possible within the graph while keeping the ratio between them the same. So for this example the bubble size might be 30px (for the 10 value) and 300px (for the 100 value). This represents the values much better visually and it abstracts away the concept that the size is linked to pixels on screen which shouldn't be the case anyways. Calculating the bubble size makes sure that they will always fit on screen even if the values have a big difference. If you have 1 and 10 or 100 and 1000 the bubble sizes should be the same on the graph since the second value is 10 times bigger in both cases. Hopefully that helps. Size should probably be changed to weight. Makes it easier to understand. |
Well I understand the way of calculating the sizes - and we have actually Anyway you mean that size is an extra dimension for the value? As in having On Tue, May 5, 2015 at 5:16 PM, Pierre-Marc Airoldi <
|
Yes. Size is a third dimension to the data. It should not just be the value of |
Okay I got it, that's what I thought. The Combine Chart example should be On Tue, May 5, 2015 at 5:30 PM, Pierre-Marc Airoldi <
|
I was a bit confused too when I was trying to implement it :p |
I'd like to use the bubble chart as a sort of scatter plot with a 3rd dimension, the size of the bubbles being its own separate value. But this is not possible with my data because the number of bubbles in each x category must be the same. Why is that? |
That isn't the case. If you look at the screenshot for bubble chart in the readme it clearly shows different bubble sizes for the same x value. |
Sorry my question is poorly worded, I see that now. I want the ability to have a different # of bubbles for each category (color in the example)- 5 red, 3 yellow, 2 green. Right now each dataset must have the same number of y values. It actually looks like this is also the case for the scatter plot. Just curious why that is. |
I saw that this was one of the issues in the android version and I need it for my project. Might think about porting it to android as well.