Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change Chart Size with WIN::OLE

Status
Not open for further replies.

wobraun

Programmer
Mar 8, 2010
3
DE
Hey all,

I am using a perl skript to write data in an excel sheet. With that data I want to generate a chart. So far everthing works fine, but I am not able to change the size of the hart. It is too small! Thanks in advance for your help

my $chart = $book -> Charts -> Add();
$chart->Location(xlLocationAsObject, $nametab);

$chart = $excel->ActiveChart;
$chart-> SetSourceData( { Source => $data, PlotBy => xlColumns } );
$chart->{ChartType} = xlLine;
$chart->{HasTitle} = 1;
$chart->ChartTitle->{Text} = "$namesch";
$chart->{HasLegend} = 0;
$chart->SeriesCollection(1)->Border->{Weight} = xlThick;
 
Hello,

Have you tried simply using a width and height property e.g.

Code:
$chart->{Width} = $width;
$chart->{Height} = $height;

Chris
 
Hey Zhris,

thx for your replay,
but it doens´t work. ...Property Width,Height could not be found.
I have read in another forum that I have to use something like $sheet->Shapes("Chart1")->ScaleWidth =
but perl shows compilation error as well. Any other idea how to solve it

Thx
Wolfgang
 
now it is running fine:

$chart->Parent->{Width} = 1300;
$chart->Parent->{Height} = 500;
$chart->Parent->{Left} = 0;
$chart->Parent->{Top} = 0;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top