Skip Menu | You are currently an anonymous guest. | Login | Return to Main | About rt.cpan.org
 

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.

X Report information
Id: 20475
Status: resolved
Left: 0 min
Priority: 0/0
Queue: SVG-TT-Graph

Owner: Nobody
Requestors: BRYCE <BRYCE [...] cpan.org>
Cc:
AdminCc:

Severity: Important
Broken in: 0.09
Fixed in: (no value)

X Attachments



X History Display mode: Brief headersFull headers
#   Sat Jul 15 18:07:28 2006 BRYCE - Ticket created  
Subject: max_scale_value (patch)
[text/plain 164b]
Thanks for the module! Seems to work well with Inkscape too.

Attached is a patch to add a max_scale_value for bar charts.
Seems to work okay for my graphs.

Bryce
Subject: Bar-max-val.diff

[text/x-patch 1.8k]
--- Bar.pm-orig 2006-02-18 05:35:27.000000000 -0800
+++ Bar.pm-new 2006-07-15 14:54:50.000000000 -0700
@@ -62,6 +62,7 @@
'width' => '300',
'show_data_values' => 1,

+ 'max_scale_value' => undef,
'min_scale_value' => '0',
'stagger_x_labels' => 0,
'rotate_x_labels' => 0,
@@ -173,6 +174,11 @@
The point at which the Y axis starts, defaults to '0',
if set to '' it will default to the minimum data value.

+=item max_scale_value()
+
+The maximum value for the Y axis. If set to '', it will
+default to the maximum data value.
+
=item show_x_labels()

Whether to show labels on the X axis or not, defaults
@@ -324,6 +330,7 @@
'style_sheet' => '',
'show_data_values' => 1,

+ 'max_scale_value' => '',
'min_scale_value' => '0',
'scale_divisions' => '',
'bar_gap' => 1,
@@ -633,17 +640,25 @@
[% min_scale_value = min_value %]
[% END %]

+ <!-- find ending value for scale on y axis -->
+ [% IF config.max_scale_value || config.max_scale_value == '0' %]
+ [% max_scale_value = config.max_scale_value %]
+ [% ELSE %]
+ <!-- setting highest value to be max_value as no max_scale_value defined -->
+ [% max_scale_value = max_value %]
+ [% END %]
+
<!-- base line -->
[% base_line = h + y %]

<!-- how much padding between largest bar and top of graph -->
- [% IF (max_value - min_scale_value) == 0 %]
+ [% IF (max_scale_value - min_scale_value) == 0 %]
[% top_pad = 10 %]
[% ELSE %]
- [% top_pad = (max_value - min_scale_value) / 20 %]
+ [% top_pad = (max_scale_value - min_scale_value) / 20 %]
[% END %]

- [% scale_range = (max_value + top_pad) - min_scale_value %]
+ [% scale_range = (max_scale_value + top_pad) - min_scale_value %]

<!-- default to 10 scale_divisions if none have been set -->
[% IF config.scale_divisions %]

#   Mon Apr 28 16:00:48 2008 LLAP - Correspondence added  
[text/plain 289b]
On Sat Jul 15 18:07:28 2006, BRYCE wrote:
> Thanks for the module! Seems to work well with Inkscape too.
>
> Attached is a patch to add a max_scale_value for bar charts.
> Seems to work okay for my graphs.
>
> Bryce

Not sure how I missed this - anyway will be in next release - thanks!
#   Mon Apr 28 16:00:50 2008 RT_System - Status changed from 'new' to 'open'  
#   Mon Apr 28 16:00:52 2008 LLAP - Status changed from 'open' to 'resolved'