I am running into a problem where I cannot color different sections of a graph I am working on. I want to change the color based on the threshold on the y axis. It seems easy from looking at the documentation from the high charts javascript, but it fails when I try to translate it into R to use rCharts. Here is what I have, with an example data frame called final.
library(rCharts)
final <- data.frame(x = c(1,2,3,4,5), y = c(15,17,20,21,22), radius = rep(3,5))
temp <- apply(final[,c("x","y","radius"])], 1, as.list)
a <- Highcharts$new()
a$series(animation = FALSE, name = "placeholder", data = temp, type = "scatter",
lineWidth = 1, zoneAxis = "y", zones = list(list(value = 20,
color = "rgba(223, 83, 83, 0.5)"),
list(color = "rgba(50, 205, 50, 0.5)")))
This does not change the plot from the default color, so I'm very confused and would greatly appreciate any help or possibly another solution. Thanks!
This is modeled off of the documentation for zones here: http://www.highcharts.com/docs/chart-concepts/series#4aaN