I have data in my excel file as

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
Now, I want to plot multiple series XYScatter. I provide the code which I'm playing with,
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";
I'm not getting the xyscatter plot with 2 series included. Please help.

In reply to Need to make a plot (XYscatter) in Excel by Viqiko

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.