1 include an rCharts into a pdf repport · Issue #105 · Rapporter/rapport · GitHub
Skip to content

include an rCharts into a pdf repport #105

@danreb25

Description

@danreb25

It's OK to generate html repports (cf #104) that include rCharts objects (tested with Highcharts charts).

But what if we would like to include rCharts generated plots into a pdf file?
In other words: can we include iframes withraw html (or inline raw html) in the brew code and produce it in the pdf generated repport?

e.g.
in the template we write something like

# test Highcharts
<%=
require(rCharts);
a <- hPlot(Pulse ~ Height, data = MASS::survey, type = "bubble", title = "Zoom demo", subtitle = "bubble chart", size = "Age", group = "Exer");
a <-gfa.rcharts.customiser.addaptLibUrlToLocalEnvironment(a,newPathPart =CST_R_CHARTS_LIBRARY );
myChartId<-  "testRapportrCharts";
myFile<-file.path('I:/Myproject','rchartsOut/');
knitr::opts_current$set(list(fig.path = myFile, label = myChartId))
save_stdout(a$show('iframe', cdn  = TRUE, standalone = TRUE));
%> 

it produces something like the following in the *.md generated file

<iframe src="proxy.php?url=https%3A%2F%2Fgithub.com%2Ffile%3A%2F%2F%2FI%3A%2FMyproject%2FrchartsOut%2FtestRapportrCharts.html" 
class='rChart highcharts '
id=iframe_chart170c37b73e76
></iframe>
<style>iframe.rChart{ width: 100%; height: 400px;}</style>

wich isn't converted in pdf (and no erro , no warnings).

Thanks for your comments

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions