
eval do "/app/reports/tools/render-lib.pl";

eval <<EOF
sub updateYaxis {
    my $obj = shift;
    my $ref = $obj->self->env->{"box"}->{"props"};
    if ( $ref->{"yAxis"} ) {
    my $ans = CLI::Template->simple($obj, $ref->{"yAxis"} )->handle( $obj, 'simple');
    $ref->{"yAxis"} = $ans;
    }
}
EOF

eval <<EOF
sub updateXaxis {
    my $obj = shift;
    my $ref = $obj->self->env->{"box"}->{"props"};
    if ( $ref->{"xAxis"} ) {
    my $ans = CLI::Template->simple($obj, $ref->{"xAxis"} )->handle( $obj, 'simple');
    $ref->{"xAxis"} = $ans;
    }
}
EOF

try
do
   go results
   template load template.html

   if "$outputMode" ne "javascript"
   do
      template header
   done
   template jshead1
   if $colors ne ''
   do
      template colors
   done
   template jshead2

   eval renderRows($obj);
   
   eval updateYaxis($obj);
   eval updateXaxis($obj);

   template jsmiddle1
   
   if $stackLabels eq "true"
   do
   	   template stackedlabels
   done
   
   if $decimals eq "false"
   do
   	   template nodecimals
   done
   
   template jsmiddle2
   
   if $decimals eq "true"
   do
   	   template formatted
   done
 
   if $decimals ne "true"
   do  
   	   template unformatted
   done
   
   template jsmiddle3
   
   if $stacked eq "true"
   do
   	   template stacked
   done
   
   template jsmiddle4

   eval renderRows($obj, 1);

   template jsfoot

   if "$outputMode" ne "javascript"
   do
      template footer
   done
catch
   message info $ERROR
done
