Apache OpenOffice (AOO) Bugzilla – Issue 83684
Automatic Y-axis scaling regression in chart objects
Last modified: 2013-02-24 21:19:03 UTC
Try this simple experiment in oocalc 2.3 release: Make a line chart of two data points, say 100 and 80 for example. Use the default Y-axis scaling of 'automatic' for everything. Note that the automatic scaling draws the Y-axis from 0 to 120. Now, increase the second data point from 80 to 83.3 and note the Y-axis scale still runs from 0 to 120. Now increase the 83.3 to 83.4 and watch the Y-axis change scale to 75-105 in one jump. This is obviously broken behavior, and started with 2.3 release, as far I as I can tell. If you can point me to the relevant code for the automatic scaling, I can probably submit a patch to fix it.
wrong component, changed to Chart and re-assigned
I checked with "OOo-dev 2.3.1 WIN XP: [680m8(Build9236)]" and can confirm the problem, Auto X-axis-arranging does not work for for y values < 84 (x-axis remains at "0". You can test that easily with attached "autoscale_sample_spinbutton.ods". Works fine with "2.2.1 Multilingual German version WIN XP: [680m18(Build9161)]" @wa1ter: What OS / Platform did you check?
Created attachment 49698 [details] sample file
rainer: I checked Linux32 and WinXP/Vista32 on x86. For me, that qualifies as "ALL" ;-)
You always should mention the system(s) you used in the report. MAC and PALM also is "All" ...
This is not a bug but an intended behavior. If the values are somehow all far from zero, zero is not the minimum anymore. For details have a look at the specification here: http://specs.openoffice.org/chart/ChartAxisAutoScaling.odt
-> I won't fix this.
My point is that the specification is not reasonable behavior. For automatic scaling to begin at MAX/MIN < 1.2 is not nearly versatile enough. For example, I depend on automatic scaling to follow stock prices, which very often will exceed that 1.2 ratio. This leaves as much as 80% of the chart area as empty space, and that makes the chart useless for my purposes. IMO that ratio should be 3.0, which would leave only the bottom fourth of the chart empty. What is the reason for picking 1.2? Thanks.
Good grief! I just tried M$ Excel for the first time in years, and I see it does automatic scaling *exactly* the same way. I guess that answers my question -- but I still think it's wrong.
Yes, the better compatibility to MS was the main reason for this exact behavior. But for your case, when you always want zero to be the minimum - why don't you just set it? You can leave the maximum at auto and set minimum to zero. Or even better: set only the 'axis at' value to zero. This will force zero to be in the automatic scale range but allows for negative values also.
I wasn't clear, sorry. I do *not* want zero all the time, just the opposite. If I display a stock with MAX=100 and MIN=80 the chart will automatically scale with zero at the bottom. I think it should scale with, say, 70 at the bottom instead. Anyway, I understand why you won't change it -- but that won't stop me from compiling OO from source and fix it the way I want it :o) If you can point me to the appropriate area of the source code I will make my own changes. Thanks very much for your help, and for working on OO.
:-) Look at the file chart2/source/view/axes/ScaleAutomatism.cxx. I think the members m_bExpandWideValuesToZero and/or m_bExpandNarrowValuesTowardZero are what you are looking for. Regards, Ingrid
It seems, that the manual axis setting does not work correctly in 2.3, so that workaround from 'comments from iha Mon Nov 19 19:49:52' will not work, pls. compare screenshots!
Created attachment 49760 [details] compares manual axis settings
Back to normal! :-) [but watch for linewrap] diff -u -r1.8 ScaleAutomatism.cxx --- ScaleAutomatism.cxx 11 Jun 2007 15:02:44 -0000 1.8 +++ ScaleAutomatism.cxx 21 Nov 2007 00:08:03 -0000 @@ -530,7 +524,7 @@ { /* If minimum equals maximum, or if minimum is less than 5/6 of maximum, set minimum to 0. */ - if( (fTempMinimum == fTempMaximum) || (fTempMinimum / fTempMaximum < 5.0 / 6.0) ) + if (fTempMinimum == fTempMaximum) { if( m_bExpandWideValuesToZero ) fTempMinimum = 0.0; Rainer: I see that the axis is where you put it, at 50, but I'm not sure what you would prefer. If you want the axis to be at the bottom then you need to set the minimum to the same value, no?
I am closing this issue now.
Okay. Just one heartfelt philosophical comment before I shut up: I'd like open source projects to be leaders rather than followers of MicroSoft. MS is still dominant because they are superb at marketing and exploiting their monopoly, but that allows them to sell crappy software at high prices. That's no reason to copy them. Happy leap year :o)