Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

You can do this in Excel::Writer::XLSX using the label_position chart axis option set to low. Here is a small working example:

use strict; use warnings; use Excel::Writer::XLSX; # Create a workbook, a worksheet and a chart. my $workbook = Excel::Writer::XLSX->new( 'chart_axis.xlsx' ); my $worksheet = $workbook->add_worksheet(); my $chart = $workbook->add_chart( type => 'column', embedded = +> 1 ); # Some data to add to plot. my $data = [ [ 1, 2, -3, 4, 5 ], [ -2, 4, 6, 8, 10 ], [ 3, -6, 9, 12, 15 ], ]; # Write the data to the worksheet. $worksheet->write( 'A1', $data ); # Add three data series to the chart. $chart->add_series( values => '=Sheet1!$A$1:$A$5' ); $chart->add_series( values => '=Sheet1!$B$1:$B$5' ); $chart->add_series( values => '=Sheet1!$C$1:$C$5' ); $chart->set_x_axis( label_position => 'low' ); # Insert the embedded chart. $worksheet->insert_chart( 'E9', $chart ); __END__

See the Excel::Writer::XLSX::Chart docs for details.

--
John.


In reply to Re: How to set x-axis label at the bottom(outside of chart) in a line chart by jmcnamara
in thread How to set x-axis label at the bottom(outside of chart) in a line chart by satyas

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



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (5)
As of 2024-04-25 15:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found