rCharts/Highcharts reversedStacks 在 R 中不工作
rCharts/Highcharts reversedStacks not working in R
我想使用 rCharts
中的 highcharts
反转柱状图中的堆叠顺序。我在 API 中找到了 yAxis.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
答案就是问题本身。我只需要更新我的包裹。在 rCharts
版本 0.4.2 中它不起作用。在 0.4.5 版本中,它确实如此。
我想使用 rCharts
中的 highcharts
反转柱状图中的堆叠顺序。我在 API 中找到了 yAxis.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
答案就是问题本身。我只需要更新我的包裹。在 rCharts
版本 0.4.2 中它不起作用。在 0.4.5 版本中,它确实如此。