【问题标题】:Invalid graphics state opencpu无效的图形状态opencpu
【发布时间】:2016-11-02 12:37:08
【问题描述】:

我目前正在使用 opencpu 来托管我的 R 包。但它没有显示图表。我得到 pdf、svg 和 pdf 链接,如果我点击其中任何一个,就会显示图表。但是,在控制台中我有这个错误“invalid graphics state In call:replayPlot(x)”。

以下是我的 R 函数。

plotGraph <- function(filename) {
  filepath<-system.file("extdata", filename, package="demp")
  sample<-read.csv(filepath,header=FALSE)
  ecg=sample[2]
  graph<-plot.ts(ecg)
}

以下是我的 angularjs 代码。

$scope.getData= function(filename){
        filename=$scope.selectedFile+".csv";    
        var req=$("#output").rplot("plotGraph", {
            filename:filename
        });
}

还有网页中的div:

<div id="output"></div>

【问题讨论】:

    标签: javascript angularjs r opencpu


    【解决方案1】:

    我已经设法通过像这样指定 div 的高度和宽度来解决它

    &lt;div id="output" style="height: 900px; width:900px"&gt;&lt;/div&gt;

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-01-05
      • 1970-01-01
      • 1970-01-01
      • 2023-03-09
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多