I was thinking of such solution, but I simply do not know where to put that path of code. Because the HTML is generated only after it returns to .PL.
in .PL i use createBarchart and doesn't have any output, since he creates the file with:
open ($outfile, ">", $dir.$filename)||die "Couldnt open the file!\n"
+;
(@outputHead) = createHeader($outfile,$filename);
print $outfile " @outputHead\n";
print $outfile " [@legendArrayBAR],\n";
for($j=0; $j<$rows;$j++){
print $outfile "['$valueMatrixBAR[$j][0]',"
+;
for($i=0; $i<$cols-1;$i++){
print $outfile " $valueMatrixBAR[$j
+][$i+1],";
if($loop_cou
+nt == $cols-2){
$line
+=~ s/,+$//;
}
$loop_count++;
}
print $outfile "],\n";
}
print $outfile " ]);
var options = {
'width': 800,
'height': 400,
title: '$title',
hAxis: {title: 'Sprint', titleTextStyle: {color
+: 'red'}}
};\n
var chart = new google.visualization.ColumnChart(
+document.getElementById('chart_div'));
chart.draw(data, options);
}\n";
(@outputFoot) =createFooter($outfile,\@CustomerList,\@SprintList,$fi
+lename);
print $outfile "@outputFoot\n";
#print "Finished writting a file\n";
close ($outfile);
I hope this code won't confuse you. It has to be like that, so it can be used generally, not just for this case. But there might be sometimes a new Database, and everything I need to add then is the unique ID of that database, and everything should work like that.
|