I'm using Rails 5.2.4, Gem Chartkick(3.3.1) and wicked_pdf(1.4.0). As many people wrote, I can also not display a pie chart on pdf through Chartkick and wicked_pdf, just "loading" is shown. The chart is correctly showing on html.
If someone could already solve this problem, please let me know which version of Chartkick and wicked_pdf was used?
I tried as below but no success:
- Add into box_report.pdf.erb
<%= wicked_pdf_javascript_include_tag "application", "chartkick" %>
- Add into controller
window_status: "FLAG_FOR_PDF"
plus add into application.js
setTimeout((function () {
window.status = "FLAG_FOR_PDF";
Object.keys(Chartkick.charts).forEach(function (key) {
Chartkick.charts[key].redraw();
});
}), 3000);
- Add wicked_pdf.rb
WickedPdf.config = {
javascript_delay: 3000,
...
}
- Add into controller
javascript_delay: 3000,