Я хочу изменить порядок укладки в столбце, используя highcharts
из rCharts
. Я нашел yAxis.reversedStacks
в API, но не смог заставить его работать в R. у кого-нибудь есть идея?
library(data.table)
library(dplyr)
library(rCharts)
myData <- data.table(XAxis = c(0,1,0,1),
Value = c(0.6,0.8,0.4,0.55),
Type = c("A", "B"))
plot <- rCharts:::Highcharts$new()
plot$chart(type = "column")
plot$plotOptions(column = list(stacking = "normal"))
for (.type in unique(myData$Type)) {
.currData <- myData %>%
filter(Type == .type)
# .productionPlot$series(name = .type, data = .currData$Availability,
# type = "line", yAxis = 1, stack = .type,
# marker = list(enabled = FALSE))
plot$series(name = .type, data = .currData$Value,
type = "column")
}
# from the jfiddle of this API page:
# http://api.highcharts.com/highcharts#yAxis.reversedStacks
#
# yAxis: {
# reversedStacks: false
# },
# it should work like this:
plot$yAxis(reversedStacks = FALSE)
plot
plot$yAxis(reversedStacks = TRUE)
, я получаю серию A выше серии B. - person   schedule 12.05.2015