0
我想从rCharts
使用highcharts
反转堆积的顺序。我在API中发现了yAxis.reversedStacks
,但没有设法使其在R内工作。有没有人有想法?rCharts/Highcharts reversedStacks在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)',那么乙级联赛乙级以上的乙级联赛。 –
不幸的是我不是。你使用的是什么设置? 我正在使用R 3.1.3 RStudio 0.98.1103 和rCharts_0.4.2 – pfuhlert
R-3.2.0和rCharts_0.4.5。你可能应该升级两个。 –