0

I am trying to figure out how to get rid of these breaks within my chart: enter image description here

Below is the R code to produce that chart. Thank you for your help.

hchart(dfDouble %>% filter(Year == 2021), "column", hcaes(x = Day, y = FC), name = "Current FC", showInLegend = TRUE) %>%
  hc_add_series(dfDouble %>% filter(Year == 2020), "column", hcaes(x = Day, y = FC), name = "Prev FC", showInLegend = TRUE) %>%
  hc_title(text = "Revenue YTD")
  • It's most helpful to provide some of your data in order to have a [good reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example). You can do this by using `dput(dfDouble)`, then paste the results into your question. – AndrewGB Dec 03 '21 at 03:31

2 Answers2

1

Yes, you can set borderWidth and that should fix the problem: https://api.highcharts.com/highcharts/plotOptions.column.borderWidth

Code in R:

library('highcharter')
highchart() %>%
  hc_chart(type = "column") %>% 
  hc_series(
    list(data=list(5, 4, 3, 5)),
    list(data=list(5, 4, 3, 5))
  ) %>% 
  hc_plotOptions(column = list(
    stacking = "normal",
    borderWidth = 0
    )
  ) 
madepiet
  • 859
  • 1
  • 5
  • 7
0

Seting plotOptions.column.borderWidth to 0 should help remove breaks between stacked column segments.

According to the documentation: The width of the border surrounding each column or bar. Defaults to 1 when there is room for a border, but to 0 when the columns are so dense that a border would cover the next column.

   plotOptions: {
    column: {
      stacking: 'normal',
      borderWidth: 0,
    },
  },

Live demo: https://jsfiddle.net/BlackLabel/1kut32c8/

API References: https://api.highcharts.com/highcharts/plotOptions.column.borderWidth

Sebastian Hajdus
  • 1,422
  • 1
  • 5
  • 14