Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Examples for saving htmlwidgets and plots #68

Open
nebuzoltanszuhai opened this issue Feb 20, 2017 · 4 comments
Open

Examples for saving htmlwidgets and plots #68

nebuzoltanszuhai opened this issue Feb 20, 2017 · 4 comments
Assignees

Comments

@nebuzoltanszuhai
Copy link

I was playing a bit with the different charts available under rAmCharts (that looks impressive btw), and now wondering, if you plan to add functions or examples especially for htmlwidgets save, that I could not make working with this package. With leaflet, plotly, etc it is really easy.

Thanks, Zoltan

@bthieurmel
Copy link
Contributor

Hi,

You have to save the plot object. A am object become a htmlwidgets after plot.

am <- amBoxplot(rnorm(100))
am
htmlwidgets::saveWidget(plot(am), file = "am.html")

We are adding a wrapper save function for next version

@bthieurmel bthieurmel self-assigned this Feb 20, 2017
@nebuzoltanszuhai
Copy link
Author

Thanks for the quick reply!
Okay, then we are closer, I tried exactly the same with amBarplot and amAngularGauge where the same method did not work, it looks like it does work for the amBoxPlot without issue.

p <- amAngularGauge(...)
htmlwidgets::saveWidget(p, file="test_widget.html")

of course parameters, bands are filled.

What error message I got:
"Error in x$width : $ operator not defined for this S4 class"

@bthieurmel
Copy link
Contributor

Yes, so you 've just have to add plot() saving widget, waiting for a simpler function.

p <- amAngularGauge(x = 10)
htmlwidgets::saveWidget(plot(p), file="test_widget.html")

@nebuzoltanszuhai
Copy link
Author

Flawless, thanks! (I was sure I tried this as well, but apparently looks like not.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants