Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

117
Visualizações
Remove white space in highchart area chart in R

I am trying to remove the white space to the left of and right of the area chart (created in R using highchart) which is shown in red in the image below.enter image description here

My reproducible code:

library(highcharter)

type <- c("A", "B", "C", "D","A", "B", "C", "D","A", "B", "C", "D")
total <- c(3300, 6080, 2780, 14054, 3638, 6360, 2722, 14148, 2681, 4761, 2080, 10080)
year <- c(2018, 2018, 2018, 2018, 2019, 2019, 2019, 2019, 2020, 2020, 2020, 2020)
df <- data.frame(type, year, total)

highchart() %>%

  hc_chart(type="area") %>%
  hc_add_series(data = subset(df, type == "D"), name = "D", type = "area", hcaes(x = year, y = total)) %>%
  hc_add_series(data = subset(df, type == "B"), name = "B", type = "area", hcaes(x = year, y = total)) %>%
  hc_add_series(data = subset(df, type == "C"), name = "C", type = "area", hcaes(x = year, y = total)) %>%
  hc_add_series(data = subset(df, type == "A"), name = "A", type = "area", hcaes(x = year, y = total)) %>%

  hc_xAxis(title = "", categories = c("2018", "2019", "2020"))

I've looked around online but I don't know JavaScript so it's difficult to figure out.

about 4 years ago · Santiago Gelvez
1 Respostas
Responde à pergunta

0

I changed hc_xAxis to use tickPositions instead of categories.

hc_xAxis(title = "", 
           min = 2018, max = 2020, 
           tickPositions = c(2018, 2019, 2020))
about 4 years ago · Santiago Gelvez Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda