Subject: | Make bars displayed at specified x value |
This is basically what this fix does:
Old bar graph of values (1, 3, 4, 7), (1, 3, 3, 1) would look like this
|
| ||
| ||
|||||
+----------
After the patch it should look like:
|
| ||
| ||
| | || |
+----------
I'm basically wondering if a flag can be added somehow to switch between the old functionality and this new one.
Here's the code change in bars.pm:
# get coordinates of top and center of bar
- my ($xp, $t) = $self->val_to_pixel($i + 1, $value, $ds);
+# my ($xp, $t) = $self->val_to_pixel($i + 1, $value, $ds);
+ my ($xp, $t) = $self->val_to_pixel($self->{_data}->get_x($i), $value, $ds);
Thanks
--- /tmp/old/bars.pm Thu Jun 24 20:35:12 2004
+++ /tmp/new/bars.pm Thu Jun 24 20:26:19 2004
@@ -251,7 +251,8 @@
if $self->{cycle_clrs} > 1;
# get coordinates of top and center of bar
- my ($xp, $t) = $self->val_to_pixel($i + 1, $value, $ds);
+# my ($xp, $t) = $self->val_to_pixel($i + 1, $value, $ds);
+ my ($xp, $t) = $self->val_to_pixel($self->{_data}->get_x($i), $value, $ds);
# calculate left and right of bar
my ($l, $r);