Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

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

by jmcnamara (Monsignor)
on Sep 13, 2011 at 10:48 UTC ( #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
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
Node Status?
node history
Node Type: note [id://925670]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (12)
As of 2014-07-30 14:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (234 votes), past polls