HighcharteR : unable to center x labels

33 Views Asked by At

I tried a lot of thing to center x labels with columns without success.

Here is a reproductible code :

library(tidyverse)
library(highcharter)

df <- data.frame(
  "sample"=c("sample 1","sample 2","sample 3","sample 4","sample 5","sample 6","sample 7","sample 8"),
  "sexe"=c("F","F","F","F","M","M","M","U"),
  "value"=c(12,14,8,10,8,6,5,12)
)

mybarplot <- df %>%
  hchart('column', hcaes(x = sample, y = value, group=sexe)) %>%
  hc_title(text="test column") %>%
  hc_plotOptions(column = list(pointWidth = 50))

The sample name are not centered with each column.

I tried lot of things :

hc_xAxis(labels=list(align="center"))

hc_plotOptions(column = list(pointWidth = 50, dataLabels = list(align="center")))

None of this line added individually in the code works.

Any clue ? Thanx

0

There are 0 best solutions below