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

Colouring bars in bar chart for polar configuration #635

Open
MrMisc opened this issue Jun 21, 2024 · 0 comments
Open

Colouring bars in bar chart for polar configuration #635

MrMisc opened this issue Jun 21, 2024 · 0 comments

Comments

@MrMisc
Copy link

MrMisc commented Jun 21, 2024

Hi again!

I have been having lots of fun using echarts packages for a while now but I was wondering if anyone could help me unravel this problem for me, using this example

I really want to colour the bars in a radial plot I have

image

I have tried the following, an attempt at extending this solution

bigtable %>%mutate(Timestamp = as.POSIXct(Timestamp, format="%Y-%m-%dT%H:%M:%S", tz="UTC")) %>%
  filter(Liberation..>0 & Player.Count>0) %>% 
  arrange(Liberation..) %>%
  mutate(colors = ifelse(Event<100, "purple","cyan")) %>% 
  # mutate(Event = exp_scale(Event)) %>%  
  e_charts(Name) %>%
  e_polar() %>% 
  e_angle_axis(max = 100) %>% 
  e_radius_axis(Name,axisLabel = list(fontSize = 11, rotate = 20, interval = 0)) %>% 
  e_bar(Liberation.., colors,coord_system = "polar",
        emphasis = list(focus = 'self'),
        label = list(
          formatter = '{c}%',
          fontSize = 9,
          show = TRUE,
          rotate = 0,
          align = 'left',
          verticalAlign = 'middle',
          position = 'insideBottom',
          rich = list(name = list())
        )) %>%
  e_add_nested("itemStyle",colors) %>% 
  e_theme("chalk") %>% 
  e_datazoom(bottom = "5%", height = 4) %>% 
  e_legend(show = FALSE) %>% 
  e_title("Liberation Status of all active planets","HELLDIVERS 2") %>% 
  e_tooltip()

Any guidance would be greatly appreciated. Thank you!

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

1 participant