樹形圖在閃亮的工作正常,但是當我轉換爲shinydashboard時,樹形圖停止工作。它現在只顯示一個空白塊。任何想法如何解決這一問題?Highcharter樹形圖不在shinydashboard中渲染
這是我server.R
output$TreeMap<-renderHighchart2({TM1<-hctreemap2(data = M,
group_vars = c("Status","Class","Order", "Family","Species"),
size_var = "n",
color_var = "n",
layoutAlgorithm = "squarified",
levelIsConstant = T,
levels = list(
list(level = 1, dataLabels = list(enabled = T)),
list(level = 2, dataLabels = list(enabled = F)),
list(level = 3, dataLabels = list(enabled = F)),
list(level = 4, dataLabels = list(enabled = F)),
list(level = 5, dataLabels = list(enabled = F))
)) %>%
hc_colorAxis(minColor = brewer.pal(9, "GnBu")[6],
maxColor = brewer.pal(9, "YlOrRd")[8]) %>%
hc_tooltip(pointFormat = "<b>{point.name}</b>:<br>
Number Measured: {point.value:,.0f}")
})
這是我ui.R
tabItem(tabName = "About",
tabsetPanel(
tabPanel("TreeMap",box(width = 12,highchartOutput2("TreeMap",height = "750px"))))
我已經嘗試過,但仍然沒有出現... –
你有一個最小的可重複的例子嗎? https://stackoverflow.com/help/mcve – jbkunst
當我構建示例時,它工作。但它仍然不能在我的原始代碼中工作。感謝您的幫助,我將不得不通過我的代碼,看看是什麼導致樹圖不能渲染。 –