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

Inverted ColumnRange chart #796

Open
lyndon-bird opened this issue Jun 12, 2023 · 1 comment
Open

Inverted ColumnRange chart #796

lyndon-bird opened this issue Jun 12, 2023 · 1 comment

Comments

@lyndon-bird
Copy link

Hi there,

I am trying to replicate this inverted column range chart https://www.highcharts.com/demo/ios/columnrange.

It appears the inverted flag has no impact of a columnrange chart.

Thanks

Please include a minimal reproducible example -

library(dplyr)

options(highcharter.theme = hc_theme_smpl())

#### DATA ####
df <- data.frame(xval = 1:10) %>% 
  mutate(
    yval = 10 + xval + 10 * sin(xval),
    yval = round(yval, 1),
    zval = (xval*yval) - median(xval*yval),
    er = 10 * abs(rnorm(length(xval))) + 2,
    er = round(er, 1),
    l = yval - er,
    h = yval + er,
    col = yval,
    nm = paste("point", xval)
  )

head(df)

hchart(df, "columnrange", hcaes(x = xval, low = l, high = h, name = nm, color = col), inverted=TRUE)

@JDenn0514
Copy link

In case you haven't figured this out yet, it's not actually a bug. You just need to add hc_chart(inverted = TRUE) to your code. Your full code would look like this:

hchart(df, 
       "columnrange", 
       hcaes(x = xval, low = l, high = h, name = nm, color = col)) %>%
  hc_chart(inverted = TRUE)

This is what my output looks like with your data and the code above:

Screenshot 2024-05-24 at 2 35 03 PM

Hope this helps!

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

2 participants