Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Spreadsheet::WriteExcel::Chart y-axis behaving not as expected

by jmcnamara (Monsignor)
on Sep 13, 2011 at 10:48 UTC ( [id://925670]=note: print w/replies, xml ) Need Help??


in reply to Spreadsheet::WriteExcel::Chart y-axis behaving not as expected

I don't actually see any substantive difference between the two charts in Excel 2007. I think that you probably want to avoid writing a data series on the chart for the first row of each data array:

... if ($i > 1) { $chart->add_series( 'categories' => xl_range_formula( 'testRight', 1, 1, 1, 13 +), 'values' => xl_range_formula( 'testRight', $i, $i, 1, +13 ), 'name' => $_->[0], ); } ...

In which case the issue is more evident.

Unfortunately, what you are seeing is a results of Excel's automatic axis scaling. There isn't (and probably won't be) any way to override this with Spreadsheet::WriteExcel. It is intended as a feature in Excel::Writer::XLSX but even that is probably a few months off.

Update: Manual scaling is now supported in Excel::Writer::XLSX >= version 0.36.

--
John.

  • Comment on Re: Spreadsheet::WriteExcel::Chart y-axis behaving not as expected
  • Download Code

Replies are listed 'Best First'.
Re^2: Spreadsheet::WriteExcel::Chart y-axis behaving not as expected
by jbrugger (Parson) on Sep 13, 2011 at 10:54 UTC
    Hi John, Thanks for your answer, the first row you mentioned is correct.

    Thing is however that the y-axis on the first chart is from 6,5 to 9, and the second one from 0 to 10.
    That makes the 2nd one more or less unreadable, where the first one is 'zoomed in' so the differences between the sets are better visible.
    To bad if it's true that we cannot change it :(
    "We all agree on the necessity of compromise. We just can't agree on when it's necessary to compromise." - Larry Wall.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://925670]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (4)
As of 2024-04-26 00:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found