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

Is it possible to create bubble chart using e_scatter #503

Open
OmasuRichard opened this issue Feb 7, 2023 · 1 comment
Open

Is it possible to create bubble chart using e_scatter #503

OmasuRichard opened this issue Feb 7, 2023 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@OmasuRichard
Copy link

OmasuRichard commented Feb 7, 2023

Hi,

I'm trying to create a bubble chart that look like this using e_scatter.

Screenshot_20230207_012116

This is what the data looks like and the state I am able to recreate now

data <- data.frame(
group = c("Upper", "Upper", "Upper", "Upper", "Upper", "Upper", "Upper", "Upper", "Lower", "Lower"),
category = c("A", "B", "C", "D", "E", "F", "G", "H", "a", "b"),
size = c(0.74, 0.72, 0.68, 0.67, 0.63, 0.54, 0.53, 0.49, 0.02, 0.02),
sample_x = c(0, 0.2, 0.4, 0.6, 0.8, 0.8, 0.6, 0.4, 0.2, 0),
sample_y = c(1, 2, 3, 2, 1, -1, -2, -3, -2, -1)
)

data |>
group_by(group) |>
e_charts(sample_x) |>
e_scatter(sample_y, size)

Screenshot_20230207_020019

Originally the data only have group, category and value columns

Because I don't have x and y in the data, is it possible to recreate the bubble chart using e_scatter ?
Or am I using the wrong chart type for this ?
(I did try by adding e_polar but I couldn't scale the size of the dot using size column)

Thank you

@rdatasculptor
Copy link
Contributor

rdatasculptor commented Feb 8, 2023

Not sure how it should be done, but something like that is possible using custom charts: https://echarts.apache.org/examples/en/editor.html?c=circle-packing-with-d3

Maybe another approach is using the graph type, in combination with the transparent color for the edges. Not sure how it looks though. But I am interested is doing some experiments when I have time.

@munoztd0 munoztd0 added the enhancement New feature or request label Aug 24, 2023
@munoztd0 munoztd0 self-assigned this Aug 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants