Skip Menu |

This queue is for tickets about the Chart-Strip CPAN distribution.

Report information
The Basics
Id: 18331
Status: resolved
Priority: 0/
Queue: Chart-Strip

People
Owner: Nobody in particular
Requestors: gro.edolnwod [...] lrep
Cc:
AdminCc:

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



Subject: Failure to draw charts with over 800 data points
Chart::Strip seems to stop working properly when I attempt to draw a chart with over 800 data points in it. The attached script ('generate.pl') reads a file ('statistics.txt') and attempts to create a chart with the data in it. If you use the abbreviated data file instead ('statistics-short.txt') the chart is drawn without problems ('wikistats-ok.png'). If you use the full file ('statistics.txt', which has 961 data points in it) the result is broken ('wikistats-mangled.png').
Subject: wikistats-mangled.png
Subject: statistics-short.txt

Message body is not shown because it is too large.

Subject: wikistats-ok.png
Download wikistats-ok.png
image/png 3.8k
wikistats-ok.png
Subject: statistics.txt

Message body is not shown because it is too large.

Subject: generate.pl
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <HTML><HEAD> <TITLE>500 Internal Server Error</TITLE> </HEAD><BODY> <H1>Internal Server Error</H1> The server encountered an internal error or misconfiguration and was unable to complete your request.<P> Please contact the server administrator, webmaster@downlode.org and inform them of the time the error occurred, and anything you might have done that may have caused the error.<P> More information about this error may be available in the server error log.<P> </BODY></HTML>
Correction - actual script attached here, sorry.
#!/usr/bin/perl use warnings; use strict; use lib '/home/earle/downlode.org/perl/lib'; use Chart::Strip; use Data::Dumper; use POSIX 'mktime'; my $debug; open my $DATA, 'statistics.txt' or die "couldn't open stats data: $!"; my @raw = <$DATA>; close $DATA; my %stage1; foreach (@raw) { chomp; my ($date, $count) = split "\t", $_; my ($day, $month, $year) = split ' ', $date; my $newdate = "$year$month$day"; $stage1{$newdate} = $count; } my @data; my $line = 0; foreach (sort keys %stage1) { $line++; $_ =~ /(\d\d\d\d)(\d\d)(\d\d)/; my ($year, $month, $day) = ($1, $2, $3); # for POSIX $year -= 1900; $month--; my $time = POSIX::mktime( 0, 0, 0, $day, $month, $year ); my $value = $stage1{$_}; push @data, { time => $time, value => $value, }; warn "$time: $value" if $debug; # warn "$line " . $stage1{$_} if $debug;; } my $chart = Chart::Strip->new( title => 'WikiWikiWeb page count', width => 600, height => 400, x_label => 'Date', y_label => 'Number of pages', transparent => 1, draw_border => 0, ); $chart->add_data(\@data, { style => 'line', color => '000000', }); open CHART, '>wikistats.png' or die "couldn't open chart for writing: $!"; print CHART $chart->png; close CHART; print Dumper \@data if $debug;
Subject: Re: [rt.cpan.org #18331] Failure to draw charts with over 800 data points
Date: Sat, 25 Mar 2006 11:50:24 -0500 (EST)
To: bug-Chart-Strip [...] rt.cpan.org, EMARTIN [...] cpan.org
From: Jeff Weisberg <jaw [...] tcp4me.com>
| Chart::Strip seems to stop working properly when I attempt to draw a | chart with over 800 data points in it. | | The attached script ('generate.pl') reads a file ('statistics.txt') and | attempts to create a chart with the data in it. If you use the your program is expecting your datafile to contain a date and count separated by a tab: my ($date, $count) = split "\t", $_; on line 856 of your datafile, the date and count are instead separated by 2 spaces, leaving $count undef. if you either correct your datafile to match your code, or you adjust your code to match your datafile, the graphs will look correct. this is not a bug in Chart::Strip. sorry.