0

Possible duplicate: Wicked PDF - Wait for AJAX request to finish

Hi,

I am generating a PDF report using wicked_pdf. I want to show plotly graphs on the report. The pdf is generated, but the graphs are not showing. In my template, I have code that invokes the callback function, which has the request url and the function to plot the graph.

I tried the option :javascript_delay => 5000 in my controller, but still no graphs, although I can see the graphs when option show_as_html: is true

What am I doing wrong?

Lesego M
  • 459
  • 1
  • 9
  • 15
  • I found this article on this https://stackoverflow.com/questions/34315834/plotly-js-how-to-run-my-javascript-only-after-plot-image-is-loaded maybe it is the same kind of issue you are facing – Naren Murali Aug 10 '17 at 18:24
  • `show_as_html` is more for previewing and tweaking design, than making sure things work. Make sure your ajax calls are fully defined with protocol and host (like `https://foo.com/ajax/endpoint.json`), this is necessary for wkhtmltopdf to download the data, because Rails' typical setup is to hit `/ajax/endpoint.json`, which won't work. – Unixmonkey Aug 31 '17 at 14:36

0 Answers0