jbkunst/highcharter

Add border radius features

lukasmartig opened this issue · 0 comments

Hola Joshua.

Thank you for your nice package. I've been using it for many years.

Recently I encountered a small thing that seems not to be yet implemented until highcharter 0.9.4: The BorderRadiusOptionsObject from Highcharts. Also, I noticed that border radiuses in general seem not to be working for polar charts. Here a minimal reproducible example:

# highcharter 0.9.4
# R 4.3.2
library(highcharter)

set.seed(14)
df = data.frame(
  Year = paste(2013:2017),
  A = round(rnorm(5, 100000, 10000)),
  B = round(rnorm(5, 100000/2, 10000/2))
)

basic_chart <- 
  highchart() %>% 
  hc_chart(type = "column") %>%
  hc_plotOptions(column = list(stacking = "normal")) %>%
  hc_xAxis(categories = df$Year) %>%
  hc_add_series(name = "A",
                data = df$A,
                stack = "Group1") %>%
  hc_add_series(name = "B",
                data = df$A,
                stack = "Group1") %>% 
  hc_yAxis(gridLineColor = 'black',
           min = 0,
           max = 300000,
           tickInterval = 100000
  )

# 1) BorderRadiusOptionsObject 
basic_chart %>% hc_plotOptions(column = list(borderRadius = 20)) # works fine, but all bar corners round -> BorderRadiusOptionsObject 
basic_chart %>% hc_plotOptions(column = list(borderRadius = list(radius = 20))) # BorderRadiusOptionsObject does not work

# 2) Angle chart issue
angle_chart <- 
  basic_chart %>% 
  hc_chart(polar = TRUE, inverted = TRUE) %>% 
  hc_pane(size = '85%', innerSize = '20%', endAngle = 270)

angle_chart %>% hc_plotOptions(column = list(borderRadius = 20)) # does not work & funny animation
angle_chart %>% hc_plotOptions(column = list(borderRadius = list(radius = 20))) # BorderRadiusOptionsObject does not work

Could be some improvement for a new update.

Best,

Lukas