Forum How do I...?

Flot charting library


I tried to search the forum for similar issues and I could not find anything related to the prince version I am using (Prince 9.0 rev 2) if the question has been raised before I would appreciate if you can link me to the answer.
I am using flot, a javascript charting library, this library uses html 5 canvas and jquery (HomePage) to build interactive charts for the web.

I tried using prince to generate a pdf for a simple example but getting an error

error: TypeError: value is not an object

The page renders on chrome, but the generated pdf will not generate the div containing the simple graph, (click here for the sample)

How to replicate the case:
Run the following from the command line
$ ./prince  --javascript  -o ~/Desktop/flot.pdf
prince: error: TypeError: value is not an object

My system information
  • Running on Mac OSX 10.8.4
  • Prince version Prince 9.0 rev 2
  • jquery version v1.8.3
My team bought new licences for prince 9 and we were hoping to use the power of 9 with its HTML 5 capabilities, so any help is appreciated,

Thank you
Flot doesn't work with Prince yet, but this is our current top priority, and we hope to make it work.
Thank you for your reply, I am evaluating JavaScript charting libraries at the moment, do you know libraries that the above prince version would support? Or is the issue in the jquery support.

Most of the charting libraries require support for the getComputedStyle DOM method, which we are just implementing now. There may be some that work with Prince 9, but we don't have specific recommendations at this time. Another possibility is to generate SVG externally.
Thank you got being patient with my questions, based on the above it seems you are working supporting this in the near future will this be a revision of prince 9 that we can upgrade to?

Hopefully, yes. We have managed to get the basic Flot example that you posted earlier rendering in an experimental build of Prince, but the graph appears too small due to a width issue caused by jQuery. Resolving all of these issues is tricky, and may require some cooperation with the library authors, as Prince is fundamentally different from web browsers in some ways.
Hi ramzi (and others), if you're trying to get Flot graphs to work in Prince documents I have investigated Prince/Flot compatibility and have some tips and tricks. It would be great to have some more examples of what you're trying to do and what problems you're seeing.

Announcement: repos for tests/utils

Hey everyone, was there ever any resolution to this?
I'm currently looking for a javascript chart library to use with prince and all the ones I've tried are not working.
Hi everyone,

Is there any update on supporting to have graphs in the PDF generated by prince?