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

Add border radius features #821

Open
lukasmartig opened this issue Jul 4, 2024 · 2 comments
Open

Add border radius features #821

lukasmartig opened this issue Jul 4, 2024 · 2 comments

Comments

@lukasmartig
Copy link

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

@superchordate
Copy link

superchordate commented Sep 17, 2024

@lukasmartig - Looks like the polar borderRadius hasn't been implemented in Highcharts yet. So that's probably not doable in highcharter since it doesn't exist in Highcharts. Some evidence:

Your point about the BorderRadiusOptionsObject stands though.

FWIW, BorderRadiusOptionsObject works using my hcslim package (https://github.com/superchordate/hcslim):

library(hcslim) # devtools::install_github('superchordate/hcslim')

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

options = list(
  chart = list(type = 'column'),
  plotOptions = list(column = list(
    stacking = 'normal',
    borderRadius = list(radius = 20)
  )),
  xAxis = list(categories = df$Year),
  series = list(
    list(name = 'A', data = df$A, stack = 'Group1'),
    list(name = 'B', data = df$B, stack = 'Group1')
  ),
  yAxis = list(
    gridLineColor = 'black',
    min = 0,
    max = 300000,
    tickInterval = 100000
  )
)

hcslim::hc_widget(options)

@lukasmartig
Copy link
Author

Hi Bryce,

many thanks for the new package! I will have a look at it asap. And yes, I then noticed, too, that the BorderRadiusOptionsObject seems not to be implemented for polar charts in the Highcharts library.

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