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

What is relation between the BubbleSize and the axis value?Can we control the size of Bubble in Bubble Chart? #2448

Closed
SamSundar1 opened this issue May 17, 2017 · 10 comments

Comments

@SamSundar1
Copy link

SamSundar1 commented May 17, 2017

I don't know what is happening.
let set1: BubbleChartDataSet = BubbleChartDataSet(yVals: dataEntries1, label: "First Set") set1._maxSize = 30
Even though i have set max size to 30 bubbles are larger according to the data values

@SamSundar1 SamSundar1 changed the title What is relation between the BubbleSize and the Xaxis value?Can we control the size of Bubble in Bubble Chart? What is relation between the BubbleSize and the axis value?Can we control the size of Bubble in Bubble Chart? May 17, 2017
@thierryH91200
Copy link
Contributor

thierryH91200 commented May 17, 2017

A bubble chart is a variation of a scatter chart in which the data points are replaced with bubbles, and an additional dimension of the data is represented in the size of the bubbles. Just like a scatter chart, a bubble chart does not use a category axis — both horizontal and vertical axes are value axes. In addition to the x values and y values that are plotted in a scatter chart, a bubble chart plots x values, y values, and z (size) values.

wikipedia

A bubble chart is a type of chart that displays three dimensions of data. Each entity with its triplet (v1, v2, v3) of associated data is plotted as a disk that expresses two of the vi values through the disk's xy location and the third through its size. Bubble charts can facilitate the understanding of social, economical, medical, and other scientific relationships.

Bubble charts can be considered a variation of the scatter plot, in which the data points are replaced with bubbles. As the documentation for Microsoft Office explains, "You can use a bubble chart instead of a scatter chart if your data has three data series that each contain a set of values. The sizes of the bubbles are determined by the values in the third data series.".[1]

capture d ecran 2017-05-17 a 11 37 47

var entries = [BubbleChartDataEntry]()
for index in 0..<ITEM_COUNT
{
    let y = Double(arc4random_uniform(100)) + 50.0
    let size =  Double(arc4random_uniform(5)) + 1
    entries.append(BubbleChartDataEntry(x: Double(index) + 0.5, y: y, size: CGFloat(size)))
}

@SamSundar1
Copy link
Author

for i in 0..<dataPoints.count {
if values1[i] != 0
{
let dataEntry = BubbleChartDataEntry(xIndex: i, value: values1[i], size: 30.0)
dataEntries1.append(dataEntry)
}
}
let set1: BubbleChartDataSet = BubbleChartDataSet(yVals: dataEntries1, label: "First Set") set1._maxSize = 30

The bubbles varies according to the data.. What is happening ..?

@thierryH91200
Copy link
Contributor

size is not a constant.

that does not make sense this is the 3rd dimension

@thierryH91200
Copy link
Contributor

update Charts in first to 3.0.2
you use v2

@SamSundar1
Copy link
Author

@thieeryH91200,Sorry for late reply but how the sizes(1 to 5) are set to the bubbles??

@thierryH91200
Copy link
Contributor

let size = Double(arc4random_uniform(5)) + 1
entries.append(BubbleChartDataEntry(x: Double(index) + 0.5, y: y, size: CGFloat(size)))
here--------------------------------------------------------------->---------------------

@SamSundar1
Copy link
Author

i don't mean that, we have sizes ranging from 1 to 5. How the sizes are choosen..?

@thierryH91200
Copy link
Contributor

4 data series, each containing 3 values:

Risk Probability Impact Exposure
Foo 10 6 60
Bar 30 8 240
Baz 90 5 450
Spong 50 2 100

Probability = axe OX
Impact = axe OY
Exposure = size is the 3rd dimension / column

one data series => 3 values

capture d ecran 2017-05-17 a 17 39 09

@SamSundar1
Copy link
Author

Thank you..Got it :)

@liuxuan30
Copy link
Member

Thanks @thierryH91200 !

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

No branches or pull requests

3 participants