Reputation: 63
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:
<%= wicked_pdf_javascript_include_tag "application", "chartkick" %>
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);
WickedPdf.config = {
javascript_delay: 3000,
...
}
javascript_delay: 3000,
Upvotes: 3
Views: 256
Reputation: 196
For displaying Pie chart you need to use <%= pie_chart #count, width, height, id, and other options goes here %>
. Make sure to use it in the template file you will be using.
Upvotes: -2