Can't print chart.js charts or exportAsImage

UI Components for JSF
Post Reply
pgathercole
Posts: 4
Joined: 15 Jun 2016, 13:09

16 Apr 2019, 17:10

Hi

Have converted a number of charts over from the older version and re-implemented them with the new Chart.js components. Am really pleased with the charts themselves but when I try to print them and/or create a PDF from them, nothing seems to work.

Using p:printer on a chart produces a complete blank and printing, for instance, a panel containing a chart prints the surrounding components but again nothing at all of the chart.

Have tried different solutions, mentioned by others, mostly based on exportAsImage but cannot get these to function at all. I even tried a direct copy of the Chart.js Export code from the Showcase but that also fails with 'TypeError: PF(...).exportAsImage is not a function' in FireFox, and very similar descriptions in other browsers.

Can anyone suggest a simple and reliable way to print charts? Have been struggling with this for quite a while and whilst I may be missing something very simple, it seems a strange omission from what is otherwise some very impressive functionality.
Primefaces 6.2.19 | Olympos 1.1.2
JSF 2.2
Glassfish 4.1.1
Windows 10 | Firefox 66.0.3

User avatar
Melloware
Posts: 1152
Joined: 22 Apr 2013, 15:48

17 Apr 2019, 13:05

It was added for 7.0 not in your 6.2.19 version.
PrimeFaces Extensions Developer
GitHub Profile: https://github.com/melloware
PrimeFaces Elite 7.0.4 / PF Extensions 7.0.1

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 3 guests