This is an automated email from the git hooks/post-receive script.

dom pushed a commit to branch master
in repository libchart-strip-perl.git.

commit 31476622d902c1a9c9bc26d946cc4e5d82ebeea3
Author: Dominic Hargreaves <d...@earth.li>
Date:   Sun Mar 18 20:59:02 2012 +0000

    Imported Upstream version 1.08
---
 CHANGES   |  3 +++
 MANIFEST  |  1 +
 META.yml  |  2 +-
 Strip.pm  |  9 ++++++---
 eg/ex6.pl | 36 ++++++++++++++++++++++++++++++++++++
 5 files changed, 47 insertions(+), 4 deletions(-)

diff --git a/CHANGES b/CHANGES
index a03b1b8..44f5790 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,4 +1,7 @@
 
+1.08
+        fixed rare divide-by-zero issue [David Precious]
+
 1.07
         drop shadows
         smooth curves
diff --git a/MANIFEST b/MANIFEST
index 2cedd48..582aa7a 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -14,6 +14,7 @@ eg/ex2.pl
 eg/ex3.pl
 eg/ex4.pl
 eg/ex5.pl
+eg/ex6.pl
 eg/ex1.png
 eg/ex2.png
 eg/ex3.png
diff --git a/META.yml b/META.yml
index 7f27be9..d6684c3 100644
--- a/META.yml
+++ b/META.yml
@@ -1,6 +1,6 @@
 --- #YAML:1.0
 name:               Chart-Strip
-version:            1.07
+version:            1.08
 abstract:           Draw strip chart type graphs.
 author:
     - Jeff Weisberg <http://www.tcp4me.com/>
diff --git a/Strip.pm b/Strip.pm
index f79e7af..c458dfd 100644
--- a/Strip.pm
+++ b/Strip.pm
@@ -5,9 +5,9 @@
 # Date: 2002-Nov-01 16:11 (EST)
 # Function: draw strip charts
 #
-# $Id: Strip.pm,v 1.21 2009/03/28 17:34:54 jaw Exp $
+# $Id: Strip.pm,v 1.22 2011/11/11 00:38:11 jaw Exp $
 
-$Chart::Strip::VERSION = "1.07";
+$Chart::Strip::VERSION = "1.08";
 
 =head1 NAME
 
@@ -697,6 +697,9 @@ sub ytics {
            $is = 10 ** floor( log($tp)/log(10) );
        }
        $st  = floor( $tp / $is ) * $is; # -> 4 - 8, ceil -> 2 - 4
+        # mathematically, tp/is cannot be less than 1
+        # but due to floating-point lossage, in rare cases, it might
+        $st ||= $is;
        $low = int( $min / $st ) * $st;
        for my $i ( 0 .. (2 * $me->{n_y_tics} + 2) ){
            my $y = $low + $i * $st;
@@ -1427,7 +1430,7 @@ sub draw_boxes {
 =head1 EXAMPLE IMAGES
 
     http://argus.tcp4me.com/shots.html
-    http://search.cpan.org/src/JAW/Chart-Strip-1.07/eg/
+    http://search.cpan.org/src/JAW/Chart-Strip-1.07/eg/index.html
 
 =head1 LICENSE
 
diff --git a/eg/ex6.pl b/eg/ex6.pl
new file mode 100755
index 0000000..4976eb1
--- /dev/null
+++ b/eg/ex6.pl
@@ -0,0 +1,36 @@
+#!/usr/local/bin/perl
+# -*- perl -*-
+
+use Chart::Strip;
+use strict;
+
+my $img = Chart::Strip->new(
+    title => 'Bee Population',
+    data_label_style => 'box',
+);
+
+my $data = [];
+for(my $t=0; $t<40; $t++){
+    my $v = (.15,0,0,-.15,1,0,-.3,0,0,0,.15,.30,.15)[$t % 25] || 0;
+
+    push @$data, {
+        time  => $^T + $t * 1000,
+        value => $v + .1,
+    };
+}
+
+# smooth graph with shadow
+$img->add_data(
+    $data, {
+        label     => 'Bees',
+        color     => 'FF0000',
+        thickness => 2,
+        style     => 'line',
+        smooth    => 1,
+        shadow    => { dx => 3, dy => 3, dw => 2, color => 'ccdddd' },
+    }
+);
+
+
+print $img->png();
+

-- 
Alioth's /usr/local/bin/git-commit-notice on 
/srv/git.debian.org/git/pkg-perl/packages/libchart-strip-perl.git.git

_______________________________________________
Pkg-perl-cvs-commits mailing list
Pkg-perl-cvs-commits@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-perl-cvs-commits

Reply via email to