Hi i am using the below mentioned cord to prepare a bar chart, but the problem i am facing is that on the y axis i.e the category values are coming as 1,2,3.... i want to change the values to something that i want like A,AB,XYZ so on, can someone help me on this

use strict; use Win32::OLE qw( in with ); use Win32::OLE::Variant; use Win32::OLE::Const 'Microsoft Excel'; use constant True=> 1; use constant False=> 0; my $Excel = Win32::OLE->new('Excel.Application', 'Quit') or die "$!"; $Excel->{'Visible'} = 1; my $Wkbook = $Excel->Workbooks->Add(); my $sheet1 = $Wkbook->Worksheets(1); #sample data $sheet1->Range("U10:W3")->{Value} = [[ 10, 20, 30 ], [ 5, 10, 20 ], [ 20, 7, 12 ], ]; my $range = $sheet1->Range( "U10:W3"); #add position, size chart1 my $chartObj = $sheet1->ChartObjects->Add( 2, 2, 600, 290 ); my $chart = $chartObj->Chart; $chart->{ChartType} = 96; $chart->SetSourceData($range); with($chart, HasLegend=> False , HasTitle=>True); $range = $sheet1->Range("U10:W63"); my $sc = $chart->SeriesCollection(1); my $ax = $chart->Axes; with($chart->PlotArea->Interior, ColorIndex=>-4142 ); with($chart, HasLegend=> False , HasTitle=> True ); with($chart->PlotArea->Border, Color=>0, LineStyle=> -4142, ColorIn +dex => -4142); with($chart->PlotArea->Interior, Color=> 16777215 ); with($chart->ChartArea->Font, Size=> 8 ); my $sc = $chart->SeriesCollection(1); my $pt = $sc->Points; with( $chart->ChartTitle, Text => 'JX'); with( $chart->ChartTitle->Font, Name=>'Arial', Size=>14, Bold=>True +); with( $ax->Item(xlValue), HasTitle => True); with( $ax->Item(xlValue)->AxisTitle, Text => "Frequency"); with( $ax->Item(xlCategory), HasTitle => True); with( $ax->Item(xlCategory)->AxisTitle, Text => "Age (Months)"); with( $sc->Interior, Color => 6697881 );

In reply to Add category values by soumyapanda

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.