I have data in my excel file as
Now, I want to plot multiple series XYScatter. I provide the code which I'm playing with,Freq SpectrumPsd Freq CpeInterpolVal 0 -44.84071 0 -140 25000 -112.2465 25000 -140 50000 -114.688 50000 -140 75000 -115.3793 75000 -140 100000 -114.9682 100000 -140 125000 -114.1693 125000 -140 150000 -114.0045 150000 -140 175000 -113.3851 175000 -140 200000 -113.559 200000 -140
I'm not getting the xyscatter plot with 2 series included. Please help.use strict; use Win32::OLE; use Win32::OLE::Const 'Microsoft Excel'; # Start Excel and make it visible # get already active Excel application or open new my $xlApp = Win32::OLE->GetActiveObject('Excel.Application') || Win32::OLE->new('Excel.Application', 'Quit'); $xlApp->{Visible} = 1; # Open existing workbook my $xlFile = 'C:/wt138.xls'; my $xlBook = $xlApp->Workbooks->Open($xlFile); my $sheet = $xlBook->Worksheets(1); my $chart = $xlBook->Charts->Add; $chart->{ChartType} = xlXYScatterLines; $chart->SeriesCollection->NewSeries; $chart->SeriesCollection(1)->{XValues} = "=Sheet1!A1:A10"; $chart->SeriesCollection(1)->{Values} = "=Sheet1!B1:B10"; $chart->SeriesCollection(1)->{Name} = "=Sheet1!B1"; $chart->SeriesCollection->NewSeries; $chart->SeriesCollection(2)->{XValues} = "=Sheet1!C1:C10"; $chart->SeriesCollection(2)->{Values} = "=Sheet1!D1:D10"; $chart->SeriesCollection(2)->{Name} = "=Sheet1!E1"; $chart->{ChartTitle} = "Freq Vs. Psd";
In reply to Need to make a plot (XYscatter) in Excel by Viqiko
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |