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

e_flip_coords doesn't flip correctly if x-axis is non-categorical #578

Open
sactyr opened this issue Oct 19, 2023 · 2 comments
Open

e_flip_coords doesn't flip correctly if x-axis is non-categorical #578

sactyr opened this issue Oct 19, 2023 · 2 comments
Labels
wontfix This will not be worked on

Comments

@sactyr
Copy link

sactyr commented Oct 19, 2023

I understand x_axis should always be categorical but perhaps we could put in class check i.e. is.character or is.factor in e_flip_coords to force an error, instead of silently generating an incorrect chart? Thank you for this great package!

With non-categorical x-axis

df <- data.frame(
  x = 1:12 # e.g. typically for months in integer
  ,y = runif(12)
)

df %>%
  e_charts(x) %>%
  e_bar(y) %>% 
  e_flip_coords()

image

With x-axis turned into factor

df <- data.frame(
  x = as.factor(1:12)
  ,y = runif(12)
)

df %>%
  e_charts(x) %>%
  e_bar(y) %>% 
  e_flip_coords()

image

@munoztd0 munoztd0 self-assigned this Oct 21, 2023
@munoztd0 munoztd0 added the bug Something isn't working label Oct 21, 2023
@munoztd0
Copy link
Collaborator

mhhh this is much more complex that I thought because it has to work for different types of graphs, with x and y as integers, etc..

@munoztd0 munoztd0 added wontfix This will not be worked on and removed bug Something isn't working labels Dec 22, 2023
@munoztd0 munoztd0 removed their assignment Dec 22, 2023
@JohnCoene
Copy link
Owner

I should not have created coord_flip

With echarts.js you should just be able to

df <- data.frame(
  x = 1:12 # e.g. typically for months in integer
  ,y = runif(12)
)

df %>%
  e_charts(y) %>%
  e_bar(x)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

3 participants