问题
I'm trying to plot efficiency in column plot with highchart.
data <- c(25,50,75,100)
a <- rCharts:::Highcharts$new()
a$chart(type = "column")
a$data(data)
a
is it possible,using rcharts to obtain below chart
回答1:
Try to use colorByPointer parameter
回答2:
This will change the color of each column in your series. Obviously, you can choose whichever color you want.
values <- c(25,50,75,100)
vcolor <- c("orange", "green", "blue", "red")
a <- rCharts:::Highcharts$new()
a$chart(type = "column")
a$series(data = list(
list(y = values[1], color = vcolor[1]),
list(y = values[2], color = vcolor[2]),
list(y = values[3], color = vcolor[3]),
list(y = values[4], color = vcolor[4])
), name = 'Data')
a
Carlos
来源:https://stackoverflow.com/questions/27284929/rcharts-highcharts-column-with-color-based-on-value