Lines 172-177
sub calculate {
Link Here
|
172 |
my @looprow; |
172 |
my @looprow; |
173 |
my %globalline; |
173 |
my %globalline; |
174 |
my $grantotal =0; |
174 |
my $grantotal =0; |
|
|
175 |
my $colors = get_colors(); |
175 |
# extract parameters |
176 |
# extract parameters |
176 |
my $dbh = C4::Context->dbh; |
177 |
my $dbh = C4::Context->dbh; |
177 |
|
178 |
|
Lines 471-476
sub calculate {
Link Here
|
471 |
push @loopcol, {coltitle => "NULL", coltitle_display => 'NULL'} if ($emptycol); |
472 |
push @loopcol, {coltitle => "NULL", coltitle_display => 'NULL'} if ($emptycol); |
472 |
push @loopline,{rowtitle => "NULL", rowtitle_display => 'NULL'} if ($emptyrow); |
473 |
push @loopline,{rowtitle => "NULL", rowtitle_display => 'NULL'} if ($emptyrow); |
473 |
|
474 |
|
|
|
475 |
my $loopcount = 0; |
474 |
foreach my $row (@loopline) { |
476 |
foreach my $row (@loopline) { |
475 |
my @loopcell; |
477 |
my @loopcell; |
476 |
#@loopcol ensures the order for columns is common with column titles |
478 |
#@loopcol ensures the order for columns is common with column titles |
Lines 484-491
sub calculate {
Link Here
|
484 |
'rowtitle_display' => $row->{rowtitle_display}, |
486 |
'rowtitle_display' => $row->{rowtitle_display}, |
485 |
'rowtitle' => $rowtitle, |
487 |
'rowtitle' => $rowtitle, |
486 |
'loopcell' => \@loopcell, |
488 |
'loopcell' => \@loopcell, |
487 |
'totalrow' => $table{$rowtitle}->{totalrow} |
489 |
'totalrow' => $table{$rowtitle}->{totalrow}, |
|
|
490 |
'fill' => ${$colors}[$loopcount]->{fill}, |
491 |
'stroke' => ${$colors}[$loopcount]->{stroke}, |
492 |
'point' => ${$colors}[$loopcount]->{point}, |
493 |
'highlight' => ${$colors}[$loopcount]->{highlight}, |
488 |
}; |
494 |
}; |
|
|
495 |
$loopcount++; |
496 |
if ( $loopcount == '6' ) { |
497 |
$loopcount = '0'; |
498 |
} |
489 |
} |
499 |
} |
490 |
for my $col ( @loopcol ) { |
500 |
for my $col ( @loopcol ) { |
491 |
my $total = 0; |
501 |
my $total = 0; |
Lines 516-519
sub null_to_zzempty ($) {
Link Here
|
516 |
return $string; # else return the valid value |
526 |
return $string; # else return the valid value |
517 |
} |
527 |
} |
518 |
|
528 |
|
|
|
529 |
sub get_colors { |
530 |
my $colors = [ |
531 |
{ |
532 |
fill => "rgba(151,187,205,0.2)", |
533 |
stroke => "rgba(151,187,205,1)", |
534 |
point => "rgba(151,187,205,1)", |
535 |
highlight => "rgba(151,187,205,1)", |
536 |
}, |
537 |
{ |
538 |
fill => "rgba(216,191,216,0.2)", |
539 |
stroke => "rgba(216,191,216,1)", |
540 |
point => "rgba(216,191,216,1)", |
541 |
highlight => "rgba(216,191,216,1)", |
542 |
}, |
543 |
{ |
544 |
fill => "rgba(240,128,128,0.2)", |
545 |
stroke => "rgba(240,128,128,1)", |
546 |
point => "rgba(240,128,128,1)", |
547 |
highlight => "rgba(240,128,128,1)", |
548 |
}, |
549 |
{ |
550 |
fill => "rgba(240,230,140,0.2)", |
551 |
stroke => "rgba(240,230,140,1)", |
552 |
point => "rgba(240,230,140,1)", |
553 |
highlight => "rgba(240,230,140,1)", |
554 |
}, |
555 |
{ |
556 |
fill => "rgba(152,251,152,0.2)", |
557 |
stroke => "rgba(152,251,152,1)", |
558 |
point => "rgba(152,251,152,1)", |
559 |
highlight => "rgba(152,251,152,1)", |
560 |
}, |
561 |
{ |
562 |
fill => "rgba(216,191,216,0.2)", |
563 |
stroke => "rgba(216,191,216,1)", |
564 |
point => "rgba(216,191,216,1)", |
565 |
highlight => "rgba(216,191,216,1)", |
566 |
}, |
567 |
]; |
568 |
|
569 |
return $colors; |
570 |
} |
571 |
|
519 |
1; |
572 |
1; |
520 |
- |
|
|