I would like to make a line chart containing one x axis sharing two y axis, one on the left side and the second one on the right of the plot in R.
I found many examples on how to do this but I don't manage to reproduce it in R with the package "highcharter".
Here are the examples :
http://jsfiddle.net/gh/get/jquery/1.7.1/highslide-software/highcharts.com/tree/master/samples/highcharts/yaxis/opposite/
http://www.highcharts.com/demo/combo-dual-axes
Here what I have done so far :
g <- highchart()%>%
hc_xAxis(categories = c("2016-01-01","2016-02-01","2016-03-01","2016-04-01","2016-05-01","2016-06-01","2016-07-01","2016-08-01","2016-09-01","2016-10-01"))%>%
hc_yAxis(
list(title = list(text = "Yaxis1")),
list(title = list(text = "Yaxis2"), opposite = TRUE)
)%>%
hc_series(
list(yAxis = 0, data = c(7.0, 6.9, 9.5, 14.5, 18.2, 21.5, 25.2, 26.5, 23.3, 18.3), name = "Data1"),
list(yAxis = 1, data = c(8.0, 7.9, 10.5, 15.5, 19.2, 22.5, 28.2, 23.5, 21.3, 14.3), name = "Data2")
)
Does anyone have an idea ?
Thank you !
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…