【发布时间】:2016-12-23 21:06:33
【问题描述】:
我是闪亮的新用户,并尝试通过库中提供的示例进行培训。 我在使用 highchart 选项时遇到了一些问题,我的绘图是一条带点的线,我想控制点的大小。
这是简化的代码:(使用“highchart”库中的示例,文件夹“demo”):
### 代码开始
library("shiny")
library("highcharter")
data(citytemp)
ui <- fluidPage(
h1("Highcharter Demo"),
fluidRow(
column(width = 4, class = "panel",
selectInput("type", label = "Type", width = "100%",
choices = c("line", "column", "bar", "spline")),
selectInput("stacked", label = "Stacked", width = "100%",
choices = c(FALSE, "normal", "percent")),
selectInput("theme", label = "Theme", width = "100%",
choices = c(FALSE, "fivethirtyeight", "economist", "darkunica", "gridlight",
"sandsignika", "null", "handdrwran", "chalk")
)
),
column(width = 8,
highchartOutput("hcontainer",height = "500px")
)
)
)
server = function(input, output) {
output$hcontainer <- renderHighchart({
hc <- highcharts_demo() %>%
hc_rm_series("Berlin") %>%
hc_chart(type = "line") %>%
hc_plotOptions(area = list(
stacking = input$stacked,
lineColor = "#ffffff",
lineWidth = 1,
marker = list(
lineWidth = 1,
radius=10,
lineColor = "#ffffff"
)))%>%
hc_tooltip(pointFormat = '<span style="color:{series.color}">{series.name}</span>:
<b>{point.percentage:.1f}%</b> ({point.y:,.0f} millions)<br/>',
shared = TRUE)
hc
})
}
shinyApp(ui = ui, server = server)
##代码结束
我做了一些研究,发现您可以使用“标记”及其选项来控制大小。但是我的图表看起来完全独立于这个功能:我为标记尝试了几个宽度和半径值,它没有改变任何东西。
有人可以告诉我我做错了什么吗? 非常感谢您的帮助!
【问题讨论】:
标签: javascript r highcharts shiny