1
我想創建一個使用Highcharter分組堆積條形圖,並需要創建它,而不使用hchart()
函數。我有以下代碼(hchart()
部分作品)。Highcharter堆疊列分組不使用hchart()
data <- data.frame(
building = c("Building A", "Building A", "Building B", "Building B"),
type = c("Rent", "Owned"),
measure = c(100, 35, 124, 150),
measure_target = c(95, 20, 122, 145)
)
# This works
hchart(data, "column", hcaes(x = "building", y = "measure", group = "type")) %>%
hc_plotOptions(column = list(stacking = "normal"))
# How do we go from the above, to something like this?
highchart() %>%
hc_xAxis(categories = data$building) %>%
hc_add_series(type = "column", data = data$measure) %>%
hc_plotOptions(column = list(stacking = "normal"))
下面的預期輸出。最終目標是添加堆積條,並在其後添加另一個hc_add_series,在measure_target
列中添加一系列點(以便比較實際值與目標值)。
除非兩個堆疊酒吧和目標一行,像:
關閉。我需要點不能連接,我想你可以做分散而不是線。但是,我找不到list.parse3。你正在使用什麼版本的highcharter?我在v 0.5.0.9999 –
Im使用dev版本 –
@PorkChop 1年前的開發版本:D,list.parseX已被list_parse/list_parse2所取代。 – jbkunst