I am trying to display some diagrams using D3 and wicked_pdf. Graphs display well when I enable the show_as_html flag. But when I create PDF files myself, only the axes appear. The chart area itself is empty. I know that JavaScript is executing since the axes are displayed after the contents of the chart. 
I tried converting SVG to a canvas object using canvg.
canvg($(this).find('#canvas')[0], $('<div>').append($(picture).clone()).html(), { ignoreMouse: true, ignoreAnimation: true })
Without changes. Then I converted the SVG to a PNG image using:
$(this).find('#chart').append("<img id='as' src='" + $(this).find('#canvas')[0].toDataURL() + "'>").show()
There is still no change. However, when I insert a similar png image into the document as a static image using wicked_pdf_image_tag , the correct image is displayed. How to get wicked_pdf to display images correctly? I do not need a format if the chart is displayed correctly.
source share