Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
#------------------------------------------------------------ # Make the all_amr_by_builds Sheet #____________________________________________________________ $Sheet = $Book->Worksheets($allamrbybuildsNum); $Sheet2 = $Book->Worksheets($allbuildsdataNum); $row = 2; $col = 1; $val = "SMRs Authorized to AMR Builds:"; &Write($row, $col, $val, 3); $row = $row + 1; foreach $oldRow (2..$rows[0]) { $col = 1; foreach $oldCol (1..7) { $val = $Sheet2->Cells($oldRow, $oldCol)->{'Value'}; if ((!($val)) && ($oldRow != 2)) { $val = "=0"; } if ($oldRow != 2) { &Write($row, $col, $val, 1); } else { &Write($row, $col, $val, 4); } $col = $col + 1; } $row = $row + 1; } #------------------------------------------------------------ # Make the all_amr_by_builds Chart #____________________________________________________________ $sourceRow = $row-1; $Range = $Sheet->Range("A3:G$sourceRow"); $Chart = $Book->Charts->Add; #$Chart->{ChartType}=xlBarClustered; $Chart->{ChartType}=xlColumnClustered; $Chart->SetSourceData({Source => $Range, PlotBy => xwColumns}); $Chart->{HasTitle} = 1; $Chart->ChartTitle->{Text} = "SMRs Assigned by Build"; $Chart->ChartTitle->Font->{Size}=10; $Chart->{HasLegend} = 1; $Chart->Legend->{Position} = xlBottom; $Chart->Axes(xlCategory, xlPrimary)->{HasTitle} = 1; $Chart->Axes(xlCategory, xlPrimary)->AxisTitle->{Text} = "By Build/Sev +erity Rating"; $Chart->Axes(xlCategory, xlPrimary)->AxisTitle->Font->{Size}=10; $Chart->Axes(xlValue, xlPrimary)->{HasTitle} = 1; $Chart->Axes(xlValue, xlPrimary)->AxisTitle->{Text} = "# of SMRs"; $Chart->Axes(xlValue, xlPrimary)->AxisTitle->Font->{Size}=10; $Chart->Location({Where => xlLocationAsObject, Name => $Sheet->{Name}} +); #$Chart = $Excel->ActiveChart; #------------------------------------------------------------ # Make the history_cati-1s Sheet #____________________________________________________________ $Sheet = $Book->Worksheets($histcati1sNum); $Sheet2 = $Book->Worksheets($histdataNum); $row = 1; $col = 1; $val = "Cumulative Status of CATI-1 SMRs (Less BCRs) - Authorized vs. +Resolved vs. Closed"; &Write($row, $col, $val, 3); $row = $row + 1; @histCATIheaders = ('Workflow States', 'Authorized to Work - Cumulativ +e', 'Resolved', 'Closed-Cumulative'); foreach $val (@histCATIheaders) { &Write($row, $col, $val, 4); $col = $col + 1; } $row = $row + 1; foreach $oldCol (2..$cols[4]) { $col = 1; foreach $oldRow (1..4) { $val = $Sheet2->Cells($oldRow, $oldCol)->{'Value'}; &Write($row, $col, $val, 1); $col = $col + 1; } $row = $row + 1; } #------------------------------------------------------------ # Make the history_cati-1s Chart #____________________________________________________________ $name = "history_cati-1s"; my $Sheet = $Book->Worksheets("history_cati-1s"); $Sheet->Activate(); $sourceRow = $row-1; $Range = $Sheet->Range("A3:D$sourceRow"); $Chart = $Book->Charts->Add; $Chart->{ChartType}=xlColumnClustered; $Chart->SetSourceData({Source => $Range, PlotBy => xwColumns}); $Chart->{HasTitle} = 1; $Chart->ChartTitle->{Text} = "AMR"; $Chart->ChartTitle->Font->{Size}=10; $Chart->{HasLegend} = 1; $Chart->Axes(xlCategory, xlPrimary)->{HasTitle} = 1; $Chart->Axes(xlCategory, xlPrimary)->AxisTitle->{Text} = "By Week"; $Chart->Axes(xlCategory, xlPrimary)->AxisTitle->Font->{Size}=10; $Chart->Axes(xlValue, xlPrimary)->{HasTitle} = 1; $Chart->Axes(xlValue, xlPrimary)->AxisTitle->{Text} = "# of SMRs"; $Chart->Axes(xlValue, xlPrimary)->AxisTitle->Font->{Size}=10; $Chart->Location({Where => xlLocationAsObject, Name => $Sheet->{Name}} +); #$Chart->Location(xlLocationAsObject, $name); #$Chart->Location(xlLocationAsObject, $Sheet->{Name}); #$Chart->Location(xlLocationAsObject, "history_cati-1s"); #$Chart->Location(2, $sheetName); $Chart = $Excel->ActiveChart;
BazB added readmore tags
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Creating Multiple Excel Graphs on different Sheets
by JamesNC (Chaplain) on Feb 19, 2004 at 04:55 UTC | |
by Anonymous Monk on Feb 19, 2004 at 15:42 UTC | |
by JamesNC (Chaplain) on Feb 19, 2004 at 16:13 UTC | |
by Anonymous Monk on Feb 20, 2004 at 18:39 UTC | |
by Grygonos (Chaplain) on Feb 26, 2004 at 19:14 UTC | |
| |
|
Re: Creating Multiple Excel Graphs on different Sheets
by CountZero (Bishop) on Feb 18, 2004 at 22:30 UTC |