r - How to set xlim and ylim range in a highcharter plot?
Asked Answered
C

1

10

I'm trying to set a specific range in my highcharter axes plot

 library(highcharter) 
 h <- highchart() %>% 
      hc_title(text = "Scatter chart with size and color") %>% 
      hc_add_series_scatter(mtcars$wt, mtcars$mpg) %>% 
      hc_exporting(enabled = TRUE)
h

The current result: scatter with range = c(5, 40) at xlim

The desired plot: scatter with range = c(5, 35) at ylim

Does anyone have ideas?

Carlenecarleton answered 8/2, 2017 at 17:15 Comment(2)
A search for highcharter found this api.highcharts.com/highcharts/yAxis.max. So in your case %>% hc_yAxis(max = 35)Laurenelaurens
PERFECT! Thanks PierreCarlenecarleton
C
13

As Pierre Lafortune commented, the answer is:

%>% hc_yAxis(max = 35)
Carlenecarleton answered 24/4, 2017 at 16:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.