1

As per the googleVis tutorial, I am attempting to dynamically embed a chart into my web page using Brew as follows:

html:

    <div class="sixteen columns" id="plot">
        <% brew('test.brew') %>
    </div>

test.brew:

    <%
    data <- ...
    linechart <- gvisLineChart(data, xvar="starttime", yvar=y_var, options=list())%>
    <%=linechart$html$chart%>

When the page is created, everything except the javascript is inserted into the html file:

    <!-- LineChart generated in R 2.15.3 by googleVis 0.3.3 package -->
    <!-- Mon Apr 22 11:40:32 2013 -->
    <!-- jsHeader -->
    <!-- divChart -->
    <div id="LineChartID50a1300cbfea">
    </div>

Does anybody know how to fix this problem so that the javascript under is also outputted?

(I know it's there, as I've checked interactively in R and also written the output to file and successfully opened the page in my browser).

Elly
  • 73
  • 7
  • Are you sure it is passing through brew? Did you set your R handlers correctly as documented in http://rapache.net/manual.html? –  Apr 22 '13 at 13:09
  • Hi jwiffels, yes - I have set my R handlers correctly. Brew output is working as expected elsewhere. It simply seems to skip anything within and including ' – Elly Apr 22 '13 at 14:28
  • Why are you explicitely calling brew? If your handlers are set correctly, I don't think you need to call brew. Have you tried putting your R code in print("helloworld") blocks? –  Apr 22 '13 at 15:56

0 Answers0