Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

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.


  • 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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://925670]
[Discipulus]: Ah! if so you must play with him not with us ;=)
[vrk]: Hope he gets better soon.
[Discipulus]: hdb sorry i profit; is known that a prime number is never a figurate one nor the sumattion of two adjacent figurates of the same order? like 3th triangular+3th tetrahedric
[Discipulus]: if known where i can read about the matter?
[choroba]: he's not really sick, we just got nobody to look after him today

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2017-04-27 07:55 GMT
Find Nodes?
    Voting Booth?
    I'm a fool:

    Results (501 votes). Check out past polls.