Subject: | wrong y value when using min_scale_value in Graph::Line |
SVG-TT-Graph-Line-0.09
perl, v5.8.5 built for i386-linux-thread-multi
Linux S154 2.6.9-22.ELsmp
When I set min_scale_value in SVG::TT:Graph::Line, the y value is too
low that I can not see the line.
I attach the patch, hope it's useful.
Subject: | Line.pm.patch |
--- /usr/lib/perl5/site_perl/5.8.5/SVG/TT/Graph/Line.pm.old 2006-11-08 14:31:09.000000000 +0800
+++ /usr/lib/perl5/site_perl/5.8.5/SVG/TT/Graph/Line.pm 2006-11-08 14:51:07.000000000 +0800
@@ -884,7 +884,7 @@
<path d="M[% x %] [% base_line %] L
[% xcount = 0 %]
[% FOREACH field = config.fields %]
- [% (dw * xcount) + x %] [% base_line - (dataset.data.$field * divider) %]
+ [% (dw * xcount) + x %] [% base_line - ((dataset.data.$field - min_scale_value) * divider) %]
[% xcount = xcount + 1 %]
[% END %]
[% (dw * (xcount - 1)) + x %] [% base_line %] Z" class="fill[% line %]"/>
@@ -895,7 +895,7 @@
[% xcount = 0 %]
[% FOREACH field = config.fields %]
[% IF xcount == 1 %] L [% END %]
- [% (dw * xcount) + x %] [% base_line - (dataset.data.$field * divider) %]
+ [% (dw * xcount) + x %] [% base_line - ((dataset.data.$field - min_scale_value) * divider) %]
[% xcount = xcount + 1 %]
[% END %]" class="line[% line %]"/>
@@ -904,12 +904,12 @@
[% FOREACH field = config.fields %]
[% IF config.show_data_points %]
<!-- datapoint shown -->
- <circle cx="[% (dw * xcount) + x %]" cy="[% base_line - (dataset.data.$field * divider) %]" r="2.5" class="fill[% line %]"/>
+ <circle cx="[% (dw * xcount) + x %]" cy="[% base_line - ((dataset.data.$field - min_scale_value) * divider) %]" r="2.5" class="fill[% line %]"/>
[% END %]
[% IF config.show_data_values %]
<!-- datavalue shown -->
- <text x="[% (dw * xcount) + x %]" y="[% base_line - (dataset.data.$field * divider) - 6 %]" class="dataPointLabel">[% dataset.data.$field %]</text>
+ <text x="[% (dw * xcount) + x %]" y="[% base_line - ((dataset.data.$field - min_scale_value) * divider) - 6 %]" class="dataPointLabel">[% dataset.data.$field %]</text>
[% END %]
[% xcount = xcount + 1 %]
[% END %]