jbkunst / highcharter

R wrapper for highcharts
http://jkunst.com/highcharter/
Other
720 stars 148 forks source link

Enabling accessibility module breaks chart #778

Closed mrjoh3 closed 1 year ago

mrjoh3 commented 1 year ago

I am trying to include the highcharts accessibility module in a basic chart. The chart works fine but when I add the dependency via hc_add_dependency the chart becomes garbled. The axis' remain but the contents disappear.

I have been reading through https://www.rpubs.com/maraaverick/accessible-highcharter as a quide and have also tried the method where the chart and dependencies are set up first before adding xAxis and series separately. This method also produced a gabled plot. So I have included the first method here as a repex.

library(highcharter)

df <- data.frame(date = seq(as.Date('2022-01-01'), length.out = 10, by = 'month'),
                 value = rnorm(10))

hchart(df, 
         type = "line",
          hcaes(x = date, 
                    y = value),
       accessibility = list(
                  enabled = TRUE,
                  keyboardNavigation = list(enabled = TRUE),
                  linkedDescription = "My Chart"
                )) |>
    hc_add_dependency(name = "modules/accessibility.js")

image

humoroussmile commented 1 year ago

This may help - this is what I'm doing until the accessibility module issue is corrected: https://github.com/jbkunst/highcharter/issues/755

This issue should directly help you as well since assistance was provided by Mara Averick themselves.

mrjoh3 commented 1 year ago

thanks @humoroussmile not sure how I missed the other issue this is clearly a duplicate. I used the older version and it work perfectly

remotes::install_github("jbkunst/highcharter@8ff41366c8c411b497b5378d27be48617360f81f")