Issue 83684 - Automatic Y-axis scaling regression in chart objects
Summary: Automatic Y-axis scaling regression in chart objects
Status: CLOSED WONT_FIX
Alias: None
Product: General
Classification: Code
Component: chart (show other issues)
Version: 3.3.0 or older (OOo)
Hardware: All All
: P3 Trivial (vote)
Target Milestone: ---
Assignee: IngridvdM
QA Contact: issues@graphics
URL:
Keywords: oooqa
Depends on:
Blocks:
 
Reported: 2007-11-16 04:02 UTC by wa1ter
Modified: 2013-02-24 21:19 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
sample file (13.63 KB, application/vnd.oasis.opendocument.spreadsheet)
2007-11-16 17:08 UTC, Rainer Bielefeld
no flags Details
compares manual axis settings (110.33 KB, application/vnd.oasis.opendocument.graphics)
2007-11-20 04:45 UTC, Rainer Bielefeld
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description wa1ter 2007-11-16 04:02:22 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.
Comment 1 frank 2007-11-16 08:56:44 UTC
wrong component, changed to Chart and re-assigned
Comment 2 Rainer Bielefeld 2007-11-16 16:35:04 UTC
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?
Comment 3 Rainer Bielefeld 2007-11-16 17:08:57 UTC
Created attachment 49698 [details]
sample file
Comment 4 wa1ter 2007-11-16 18:21:15 UTC
rainer:  I checked Linux32 and WinXP/Vista32 on x86.  For me, that qualifies
as "ALL" ;-)
Comment 5 Rainer Bielefeld 2007-11-16 19:03:24 UTC
You always should mention the system(s) you used in the report. MAC and PALM
also is "All" ... 
Comment 6 IngridvdM 2007-11-19 17:08:08 UTC
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
Comment 7 IngridvdM 2007-11-19 17:09:07 UTC
-> I won't fix this.
Comment 8 wa1ter 2007-11-19 17:59:34 UTC
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.
Comment 9 wa1ter 2007-11-19 19:33:42 UTC
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.
Comment 10 IngridvdM 2007-11-19 19:49:52 UTC
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.
Comment 11 wa1ter 2007-11-19 21:49:52 UTC
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.
Comment 12 IngridvdM 2007-11-19 22:02:11 UTC
:-) 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
Comment 13 Rainer Bielefeld 2007-11-20 04:43:45 UTC
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! 
Comment 14 Rainer Bielefeld 2007-11-20 04:45:29 UTC
Created attachment 49760 [details]
compares manual axis settings
Comment 15 wa1ter 2007-11-21 00:31:04 UTC
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?
Comment 16 IngridvdM 2008-02-29 08:46:32 UTC
I am closing this issue now.
Comment 17 wa1ter 2008-03-01 00:09:11 UTC
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)