Issue with Drawing Text at Arbitrary Angles in JpGraph

21 views
Skip to first unread message

Francisco Lara Natoli

unread,
Jan 17, 2025, 3:58:26 AMJan 17
to JpGraph
  I’m encountering an error while trying to rotate axis labels in JpGraph. The error message is as follows:
  
Amenadiel\JpGraph\Util\JpGraphExceptionL: Internal font does not support drawing text at arbitrary angle. Use TTF fonts instead. in file /var/www/vendor/amenadiel/jpgraph/src/util/JpGraphError.php on line 33

Here’s the code snippet where the issue occurs:

// Configurar los ejes
$graph->SetUserFont('/usr/share/fonts/ttf-dejavu/DejaVuSans-Bold.ttf');

$graph->title->SetFont(FF_USERFONT,FS_BOLD,12);

$graph->xaxis->SetTickLabels($months);
$graph->xaxis->SetLabelAngle(45);
$graph->yaxis->HideLine(false);
$graph->yaxis->HideTicks(false, false);



I am using a TrueType font for the axis labels, but I’m still getting the error about internal fonts not supporting text rotation.

Could someone please guide me on what I might be missing or how I can resolve this?

Thank you in advance for your help!

Reply all
Reply to author
Forward
0 new messages