datastorm-open / rAmCharts

API for Amcharts
48 stars 16 forks source link

Error when calling plot() #98

Open kcsanad98 opened 3 years ago

kcsanad98 commented 3 years ago

Hi!

The method for saving mentioned in issue #68 stopped working in version 2.1.13. It's working fine in 2.1.11 though. The error is thrown when calling the plot() function. This can be reproduced with the following code:

library(rAmCharts)

data <- data.frame(
  label = c("label1", "label2"),
  value = c(1, 2),
  stringsAsFactors = FALSE
)

rAmCharts::amPie(data = data) -> widget

htmlwidgets::saveWidget(
  widget = plot(widget),
  file = "widget.html"
)

It gives the following error message:

Error in as.double(y) : cannot coerce type 'S4' to vector of type 'double'