Changeset 19493
- Timestamp:
- 09/18/08 16:12:36 (5 years ago)
- Location:
- lang/perl/Google-Chart-DBIC/trunk
- Files:
-
- 2 modified
-
lib/Google/Chart/DBIC.pm (modified) (2 diffs)
-
t/01_usage.t (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lang/perl/Google-Chart-DBIC/trunk/lib/Google/Chart/DBIC.pm
r17840 r19493 79 79 isa => 'Google::Chart::DBIC::KeyColumn' 80 80 ); 81 has 'value_column' => ( 82 is => 'rw', 83 isa => 'Str', 84 ); 81 85 82 86 __PACKAGE__->meta->make_immutable; … … 124 128 push @$axis_x, $axis unless grep {$_ eq $axis} @$axis_x; 125 129 126 # if ($axis_column && scalar @primary > 1 && 127 for my $col ($row->columns) {130 for my $col ($row->columns, $self->value_column) { 131 next unless $col; 128 132 next unless $row->has_column_loaded($col); 129 133 next if $axis_column && $col eq $axis_column; 130 my $v = $row-> $col;134 my $v = $row->get_column($col); 131 135 next unless Scalar::Util::looks_like_number $v; 132 136 my $k = $col; -
lang/perl/Google-Chart-DBIC/trunk/t/01_usage.t
r17834 r19493 1 1 use strict; 2 2 use warnings; 3 use Test::More tests => 3 3;3 use Test::More tests => 37; 4 4 use FindBin; 5 5 use lib "$FindBin::Bin/lib"; … … 210 210 is $h{cht}, 'bvg'; 211 211 } 212 { 213 my $rs = $resultset->search({ 214 place => '東京', 215 },{ 216 select => ['rainfall', 'month'], 217 as => ['rain', 'axis_x'], 218 }); 219 my $chart = Google::Chart::DBIC->new({ 220 resultset => $rs, 221 value_column => 'rain', 222 color => ['ccccff'], 223 size => '500x300', 224 type => { 225 module => 'Bar', 226 args => { 227 stacked => 0, 228 }, 229 } 230 }); 231 232 isa_ok $chart, 'Google::Chart::DBIC'; 233 234 my $uri = URI->new($chart->as_uri); 235 diag $uri; 236 ok ($uri); 237 my %h = $uri->query_form; 238 is $h{chs}, '500x300'; 239 is $h{cht}, 'bvg'; 240 } 212 241 213 242 1;
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)