diff options
| author | fukachan <fukachan> | 2006-09-24 06:18:38 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2006-09-24 06:18:38 +0000 |
| commit | 2743e8ebd2395313edf5dc74a2f4b20e5564aeca (patch) | |
| tree | 5a31bd1f75ee6002d630308d4e6b6f676fb2ffde | |
| parent | fe9da6e298f2191f4384201498075b81dce8917c (diff) | |
| download | fml8-2743e8ebd2395313edf5dc74a2f4b20e5564aeca.tar.gz fml8-2743e8ebd2395313edf5dc74a2f4b20e5564aeca.tar.bz2 fml8-2743e8ebd2395313edf5dc74a2f4b20e5564aeca.zip | |
fix initialization code.
_shrink_date() for column list.
sort main data before printing.
| -rw-r--r-- | fml/lib/FML/Demo/Chart.pm | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/fml/lib/FML/Demo/Chart.pm b/fml/lib/FML/Demo/Chart.pm index 581017be..81b5a728 100644 --- a/fml/lib/FML/Demo/Chart.pm +++ b/fml/lib/FML/Demo/Chart.pm @@ -4,7 +4,7 @@ # All rights reserved. This program is free software; you can # redistribute it and/or modify it under the same terms as Perl itself. # -# $FML: Chart.pm,v 1.1 2006/02/01 12:35:45 fukachan Exp $ +# $FML: Chart.pm,v 1.2 2006/07/09 12:11:12 fukachan Exp $ # package FML::Demo::Chart; @@ -330,19 +330,19 @@ sub print_as_csv my ($k, $v); # labels at 1st raw. - my (@r) = (""); + my (@r) = (); for my $y (@$column_list) { if ($alias->{ $y }) { push(@r, $alias->{ $y }); } else { - push(@r, $y); + push(@r, $self->_shrink_date($y)); } } print join(",", @r), "\n"; # main data. - for my $x (sort keys %$data) { + for my $x (sort {$a <=> $b} keys %$data) { for my $y (@$column_list) { if (defined $data->{ $x }->{ $y }) { print $data->{ $x }->{ $y }; |
