Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Pie Chart fonts missing in PDF

  • deliot
  • deliot's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
5 years 10 months ago #168054 by deliot
Pie Chart fonts missing in PDF was created by deliot
Hello, when I print a Pie Chart in a PDF, there is no text, either for the legend, or for the "pie slice" percentages.

Any suggestions?





Example of a pie chart from a PDF:

The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 10 months ago #168059 by holch
Replied by holch on topic Pie Chart fonts missing in PDF
The most basic information is missing: Which LS version? Without that, it will be very difficult to reproduce.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The topic has been locked.
  • deliot
  • deliot's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
5 years 10 months ago #168070 by deliot
Replied by deliot on topic Pie Chart fonts missing in PDF
Forgot...

Version 3.7.1+180424
Chrome Browser
Ubuntu 16.04 installation
The topic has been locked.
  • deliot
  • deliot's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
5 years 10 months ago #168071 by deliot
Replied by deliot on topic Pie Chart fonts missing in PDF
Also, here's what I get when I hover over the pie chart.


Attachments:
The topic has been locked.
More
5 years 5 months ago #174725 by gbl_amorim
Replied by gbl_amorim on topic Pie Chart fonts missing in PDF
Got the same problem here, did you solve it?
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 5 months ago #174742 by DenisChenu
Replied by DenisChenu on topic Pie Chart fonts missing in PDF

holch wrote: The most basic information is missing: Which LS version? Without that, it will be very difficult to reproduce.


Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
More
5 years 5 months ago - 5 years 5 months ago #174748 by gbl_amorim
Replied by gbl_amorim on topic Pie Chart fonts missing in PDF
Version: 3.14.5

I did some changes in the code and now I can show the legend, but they're wrong and still no percentage in any slice.


Edit: the legend isn't wrong but I would like to show the question text in the place of the numbers.

Edit2: I just figure out how to make the percentages work, in limesurvey\application\helpers\admin\statistics_helper.php where the 3D pie chart is created the "setFontProprieties" was poiting to '$rootdir."/fonts/".$chartfontfile', but the fonts are in '$rootdir."/assets/fonts/".$chartfontfile'. Now I just need to change te text.

Just a question, the option "graph type" was supposed to work just when i select html format or for pdf too? Because it doesn't, the graph type shown is the one i've set when creating the question.
Attachments:
Last edit: 5 years 5 months ago by gbl_amorim.
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 5 months ago #174749 by holch
Replied by holch on topic Pie Chart fonts missing in PDF

Edit2: I just figure out how to make the percentages work, in limesurvey\application\helpers\admin\statistics_helper.php where the 3D pie chart is created the "setFontProprieties" was poiting to '$rootdir."/fonts/".$chartfontfile', but the fonts are in '$rootdir."/assets/fonts/".$chartfontfile'. Now I just need to change te text.


Update to the latest version, see if the problem persists. If it persists: make a bug report. Your changes might be overwritten by any future update you might make, so I think it is best that it is fixed in the core, rather than you hacking the code. Might be a temporary solution, but is not future proof.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The following user(s) said Thank You: DenisChenu, gbl_amorim
The topic has been locked.
  • deliot
  • deliot's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 years 10 months ago #183528 by deliot
Replied by deliot on topic Pie Chart fonts missing in PDF
So a year later I still have the same issue! Thankfully, I found the problem, and set up a workaround.

ISSUE: PDF legends on pie graphs and other graphs have no text. I found the problem by setting debug to "2" in the config.php file. This showed a number of PHP warnings linked to pChart.class.php and specifically a link to a missing file found along the path /HOMEDIR/fonts/DejaVuSans.ttf. It turns out that there is no fonts folder in this location, but there is one along the path /HOMEDIR/assets/fonts/DejaVuSans.ttf. I'm guessing this is because I have upgraded (properly) a number of times, and somehow the MySQL database still has a reference to the old path.

WORK AROUND: For now, I just created a symbolic link so that /fonts points to /assets/fonts. At some later date, perhaps I'll track down the error in the database.

NOTE: This seems somehow related to this bug report: bugs.limesurvey.org/view.php?id=13338

My current LimeSurvey version 3.16.1+
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose