没有高亮度yaxis闪亮的自动调整大小 [英] No auto resize of yaxis of highcharts in shiny

查看:84
本文介绍了没有高亮度yaxis闪亮的自动调整大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想包含一个高图,当选择或取消选择一个闪亮的应用程序时,它会自动调整其y轴。



以下图表正常工作Rstudio的浏览器窗格

  library(rCharts)
dat < - data.frame(expand.grid(group =字母[1:3],x =字母[4:6]),y = c(0.1,1:8))
hPlot(x =x,y =y group,data = dat,type =line)

但它不起作用,当我将它包含在一个闪亮的应用程序中:

pre $ library(shiny)
runApp(shinyApp(
ui = fluidPage (
mainPanel(showOutput(h,'highcharts'))
),
server = function(输入,输出){
输出$ h< - renderChart2({
dat < - data.frame(expand.grid(group = letters [1:3],x = letters [4:6]),
y = c(0.1,1:8))
hPlot(x =x,y =y,groups =group,data = dat,type =line)
})
}
))

这是为什么?

解决方案

这是由于运行的高级版本与jquery版本之间的冲突造成的。 Shiny正在使用jQuery的更高版本。当你使用闪亮的jQuery 1.9.1以外的地方打电话给highcharts时。在运行时,控制台出现错误,系统被删除/添加为

  TypeError:无效'in'操作数样式

Highcharts的版本是 Highcharts JS v3.0.1(2013-04-09 )。可能需要按照建议使用更高版本的highcharts http:// forum.highcharts.com/viewtopic.php?f=9&t=22040



被引用为highcharts上的一个已知错误 https://github.com/highslide-software/highcharts.com/issues/1890


I would like to include a highchart plot that automatically resizes its y-axis when groups are selected or deselected into a shiny application.

The following plot works fine in the viewer pane of Rstudio

library(rCharts)
dat <- data.frame(expand.grid(group = letters[1:3], x = letters[4:6]), y = c(0.1,1:8))
hPlot(x = "x", y = "y", groups = "group", data = dat, type = "line")

but it does not work, when I include it into a shiny application:

library(shiny)
runApp(shinyApp(
  ui = fluidPage(
    mainPanel(showOutput("h", 'highcharts'))
  ), 
  server = function(input, output) {
    output$h <- renderChart2({ 
      dat <- data.frame(expand.grid(group = letters[1:3], x = letters[4:6]),
                        y = c(0.1,1:8))
      hPlot(x = "x", y = "y", groups = "group", data = dat, type = "line")
    })
  }
))

Why is this?

解决方案

This is due to a clash between the version of highcharts running and the version of jquery. Shiny is using a later version of jquery. When you call highcharts outside shiny jquery 1.9.1 is being used. The error in the console when shiny is ran and a series is removed/added is

TypeError: invalid 'in' operand style

The version of highcharts is Highcharts JS v3.0.1 (2013-04-09). It maybe necessary to use a more uptodate version of highcharts as suggested http://forum.highcharts.com/viewtopic.php?f=9&t=22040

Referenced as a known bug on highcharts https://github.com/highslide-software/highcharts.com/issues/1890

这篇关于没有高亮度yaxis闪亮的自动调整大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆