Skip Menu |

This queue is for tickets about the GDGraph CPAN distribution.

Maintainer(s)' notes

There are plenty of good ideas of what people can do published here on the queue. Turning a patch from the tracker into a pull request is not one of them. In order to get maintainers' attention way more quickier, PR should have at least a sample included. We know it's hard to test images generating software, but it doesn't mean we can not test numbers produced by intermediate algorithms used to generate these images, so either a test or a sample.

Report information
The Basics
Id: 1737
Status: resolved
Priority: 0/
Queue: GDGraph

People
Owner: Nobody in particular
Requestors: tex [...] engsoc.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 1.35
Fixed in: (no value)



Subject: Incorrect orientation and position of Y Label if using set_y_label_font
First thank you for GD::Graph. It helps me a lot and is fun to work with. The problem that I have happens when I use a ttf in Basically my y label is rotated -90 instead of 90 degress from horizontal when I set any ttf for set_y_label_font. The y label is also not positioned correctly using y_label_position in the vertical direction. With the value set to 1 to only lies halfway up the axis. Run this script and look at the resulting output (put cetus.ttf in the working directory or supply the relative path to a ttf on the command line) which demonstrates the two issues. My environment: SunOS 5.8 perl 5.6.1 GD 2.02 GD::Graph 1.35 #!/usr/bin/perl use GD::Graph::mixed; my ($customer, %data, $ttf); $ttf = defined $ARGV[0] ? $ARGV[0] : 'cetus.ttf'; $customer = 'y_label'; %data = ( date_ranges => [ 'Week', 'Month', 'Quarter', 'Year' ], avg => ['2.50', '13.00', '17.50', '17.50'], ); my $g = GD::Graph::mixed->new (350,150); my @gData = ( $data{'date_ranges'}, $data{'avg'}); $g->set(title => 'New Items to Date', y_label => 'Items', y_label_position=>'1', transparent => 0, types => [ 'bars', 'linespoints' ], ); $g->set_y_label_font("$ttf", 12); open(IMG, ">$customer-graph.png") or die $!; binmode IMG; print IMG $g->plot(\@gData)->png; close IMG;
From: tex [...] engsoc.org
Here is a clearer description of the issue: The problem that I have happens when I use a True Type Font as my y label font. The text will be rotated -90 instead of 90 degress from horizontal as when using internal gd fonts. Thanks, Clayton
From: joepepin [...] att.com
[guest - Tue Oct 29 16:27:01 2002]: Happens with set_title_font, too. SunOS 5.8 perl 5.8.0 GD 2.05 GD::Graph 1.35 gd-2.0.9 freetype-2.1.3
[guest - Tue Oct 29 16:27:01 2002]: Show quoted text
> The problem that I have happens when I use a ttf in Basically my y > label is rotated -90 instead of 90 degress from horizontal when I set > any ttf for set_y_label_font.
Sorry for getting back to you so late on this. I ran your test program, and I get the output I expect. In other words: The orientation for a TTF output is the same as the orientation for a builtin font (with the base of the letters to the right, and the top to the left). In my experience with how rotations work, mathematically, that's a rotation of 90 degrees (counter-clockwise being the positive direction). Did you expect it to be different, or was it indeed different for you when you reported this problem? Show quoted text
> The y label is also not positioned correctly using y_label_position in > the vertical direction. With the value set to 1 to only lies halfway > up the axis.
This could be a problem with the way I documented it. The text will always line up in such a way that its right or left edge lines up with the top or bottom of the chart 9the axes, that is). When given a 1. the top of the text lines up with the top of the axes, and when 0, the bottom lines up with the bottom. You can give it larger and smaller values, but I wouldn't advise that. Show quoted text
> My environment: > SunOS 5.8 > perl 5.6.1 > GD 2.02 > GD::Graph 1.35
My current one: Linux, redhat 8 perl 5.8.0 GD 2.0.6 GD::Graph 1.39 I get the same with perl 5.6.1 and GD 1.41 Martien
From: tex [...] engsoc.org
[MVERB - Thu Feb 20 22:33:37 2003]: Show quoted text
> [guest - Tue Oct 29 16:27:01 2002]: >
> > The problem that I have happens when I use a ttf in Basically my y > > label is rotated -90 instead of 90 degress from horizontal when I
> set
> > any ttf for set_y_label_font.
> > Sorry for getting back to you so late on this.
Im very sorry for getting back to you so late on this. After working on this a bit and reading in either GD or GD::Graph docs I discovered that the version of libgd I had installed had a bug that would apply rotations twice, hence the incorrect orientation. I updated libgd, rebuilt GD, and everything was fine. Thank you so much for such an amazingly helpful set of modules. Clayton