Invalid graphics state opencpu
<p>I'm currently using opencpu to host my R packages. But it is not displaying the graph. I get the pdf, svg and pdf links and the graph is displayed if I click on either one of them. However, within the console I have this error "invalid graphics state In call:replayPlot(x)".</p>

<p>The following is my R function.</p>

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

<p>And the following is my angularjs code.</p>

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

<p>And the div in the webpage:</p>

<pre><code>&lt;div id="output"&gt;&lt;/div&gt;
</code></pre>