R 高图粘滞跟踪

R 高图粘滞跟踪,r,highcharts,shiny,rcharts,R,Highcharts,Shiny,Rcharts,我正在尝试将R与以下代码一起使用: 服务器.R require(rCharts) shinyServer(function(input, output) { output$myChart <- renderChart({ names(iris) = gsub("\\.", "", names(iris)) p1 <- hPlot(input$x, input$y, data = iris, type = c("scatter")) p1$plotOptio

我正在尝试将R与以下代码一起使用:

服务器.R

require(rCharts)
shinyServer(function(input, output) {
  output$myChart <- renderChart({
    names(iris) = gsub("\\.", "", names(iris))
    p1 <- hPlot(input$x, input$y, data = iris, type = c("scatter"))
    p1$plotOptions(series = list(stickyTracking = FALSE))
    p1$addParams(dom = 'myChart')
    return(p1)
  })
})
此应用程序在此处联机:。问题是,如果我将鼠标悬停在某些点上,然后退出绘图,工具提示仍会显示。我预计stickyTracking=FALSE会将其关闭。我错过什么了吗


我也尝试过使用工具提示的followPointer选项,但没有成功。

这是因为highCharts JavaScript库的旧副本与较新的JQuery库之间发生冲突。一种临时解决方案是使用CDN而不是本地脚本:

library(rCharts)
library(shiny)
options(rcharts.cdn = TRUE)

runApp(
  list(ui = pageWithSidebar(
    headerPanel("highcharts"),

    sidebarPanel(
      selectInput(inputId = "x",
                  label = "Choose X",
                  choices = c('SepalLength', 'SepalWidth', 'PetalLength', 'PetalWidth'),
                  selected = "SepalLength"),
      selectInput(inputId = "y",
                  label = "Choose Y",
                  choices = c('SepalLength', 'SepalWidth', 'PetalLength', 'PetalWidth'),
                  selected = "SepalWidth")
    ),
    mainPanel(
      showOutput("myChart", "highcharts")
    )
  )
  , server = function(input, output) {
    output$myChart <- renderChart({
      names(iris) = gsub("\\.", "", names(iris))
      p1 <- hPlot(input$x, input$y, data = iris, type = c("scatter"))
      p1$plotOptions(series = list(stickyTracking = FALSE))
      p1$addParams(dom = 'myChart')
      return(p1)
    })
  })
  )
库(rCharts)
图书馆(闪亮)
选项(rcharts.cdn=TRUE)
runApp(
列表(ui=pageWithSidebar(
headerPanel(“高图”),
侧栏面板(
选择输入(inputId=“x”,
label=“选择X”,
选项=c('separalength','separalwidth','petalalength','PetalWidth'),
selected=“separalength”),
选择输入(inputId=“y”,
label=“选择Y”,
选项=c('separalength','separalwidth','petalalength','PetalWidth'),
已选择=“SepalWidth”)
),
主面板(
显示输出(“myChart”、“highcharts”)
)
)
,服务器=功能(输入,输出){

输出$myChart由于highCharts的旧版本与jQuery冲突,此功能不正确。请参阅。希望更新的JavaScript库将添加到rCharts。在此之前,您可以使用
选项(rCharts.cdn=TRUE)
library(rCharts)
library(shiny)
options(rcharts.cdn = TRUE)

runApp(
  list(ui = pageWithSidebar(
    headerPanel("highcharts"),

    sidebarPanel(
      selectInput(inputId = "x",
                  label = "Choose X",
                  choices = c('SepalLength', 'SepalWidth', 'PetalLength', 'PetalWidth'),
                  selected = "SepalLength"),
      selectInput(inputId = "y",
                  label = "Choose Y",
                  choices = c('SepalLength', 'SepalWidth', 'PetalLength', 'PetalWidth'),
                  selected = "SepalWidth")
    ),
    mainPanel(
      showOutput("myChart", "highcharts")
    )
  )
  , server = function(input, output) {
    output$myChart <- renderChart({
      names(iris) = gsub("\\.", "", names(iris))
      p1 <- hPlot(input$x, input$y, data = iris, type = c("scatter"))
      p1$plotOptions(series = list(stickyTracking = FALSE))
      p1$addParams(dom = 'myChart')
      return(p1)
    })
  })
  )