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: 4939
Status: resolved
Worked: 20 min
Priority: 0/
Queue: GDGraph

People
Owner: Nobody in particular
Requestors: mverb [...] cpan.org
Cc:
AdminCc:

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



Subject: Need help with infinite loop in GD::Graph
Date: Wed, 14 Jan 2004 21:58:40 +0000 From: john mcilwain <johnmcilwain@hotmail.com> Subject: Re: Need help with infinite loop in GD::Graph To: martien.verbruggen@tradingpost.com.au Message-id: <Law9-F122PTWgpGnUT6000293be@hotmail.com> Sure! use GD; use GD::Graph; use GD::Graph::lines; @data = ( ["1st"], [ -1], ); $graph = GD::Graph::lines->new(400, 300); $graph->set( x_label => 'X Label', y_label => 'Y label', title => 'Some simple graph', y_max_value => 8, y_tick_number => 8, y_label_skip => 2 ); $gd = $graph->plot(\@data); Show quoted text
>From: Martien Verbruggen <mgjv@tradingpost.com.au> >Reply-To: Martien Verbruggen <mgjv@tradingpost.com.au> >To: john mcilwain <johnmcilwain@hotmail.com> >Subject: Re: Need help with infinite loop in GD::Graph >Date: Thu, 15 Jan 2004 08:39:58 +1100 > >On Wed 14 Jan 21:22 PM, john mcilwain wrote: >
> > Hi Martien, > > > > I posted this on news the other day and thought I'd send it directly
to Show quoted text
>you,
> > in case you have time to look at it ;-) > > > > I am nervous about making changes that could affect other parts... > > > > --- > > > > I am plotting a line graph with 1 data point "9:00" and "-1" > > > > Inside axestype.pm, ~line 1627, there is a comment about > > this possibly happening... > > > > This module sets min="-0.5" and max="-1.5" > > (guess min and max can't be the same value ie: -1) > > > > This snippet is where the problem lays: > > # create array of interval sizes > > my $s = 1; > > while ($s < $range) { $s *= 10 } > > ->while ($s > $range) { $s /= 10 } > > my @step = map {$_ * $s} (0.2, 0.5, 1, 2, 5); > > > > Range keeps getting smaller and never exits the while loop, > > here are the values going into the snippet above: > > $s = "1" > > $range = "-1" > > > > What if $s and $range are equal? > > It seems like it doesn't check for negative values...but then I
failed Show quoted text
>math
> > ;-)
> >You're right. There's a problem there. I should probably use the >absolute value. Do you maybe have a small snippet of code that I could >use as a test case? It'll make my life a little easier when fixing the >problem:) > >Thanks,