Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with Drawing Text at Arbitrary Angles in JpGraph #150

Open
desarrolloebisum opened this issue Jan 17, 2025 · 0 comments
Open

Issue with Drawing Text at Arbitrary Angles in JpGraph #150

desarrolloebisum opened this issue Jan 17, 2025 · 0 comments

Comments

@desarrolloebisum
Copy link

Hello,

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:

// Configuring the axes
$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); // This rotates the X axis labels by 45 degrees
$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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant