Bug 51656 - Mean value line starts in wrong place in column graph
Summary: Mean value line starts in wrong place in column graph
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Chart (show other bugs)
Version:
(earliest affected)
3.5.4 release
Hardware: x86-64 (AMD64) Linux (All)
: lowest minor
Assignee: Prashant
URL:
Whiteboard: target:4.1.0
Keywords: difficultyBeginner, easyHack, skillCpp, skillDebug
Depends on:
Blocks:
 
Reported: 2012-07-02 09:10 UTC by Kyle Bentley
Modified: 2015-12-15 12:17 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
scatter plot vs column plot with mean value line (21.76 KB, image/png)
2012-07-02 09:10 UTC, Kyle Bentley
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kyle Bentley 2012-07-02 09:10:37 UTC
Created attachment 63707 [details]
scatter plot vs column plot with mean value line

While attempting to insert a mean value line into a column graph, I noticed that the line itself starts in the middle of the first bar, instead of the starting on the vertical axes.  Plotting the same data works for a scatter plot.

Steps to reproduce:

1.  Type a list of numbers into calc, ex:
 3
 5
 4
 3
 7
 9

2.  Create a column graph
3.  Insert mean value line
4.  Notice that it starts in the middle of the first bar.

I have a screen cap below, showing the xy scatter plot with mean value line, vs the column graph with mean value line.  A picture is worth 1000 words.

I've also confirmed on other ubuntu boxes.

Ubuntu 12.04 x84
AMD Catalyst 12.6
Kernel 3.4.4
LO 3.5.4.2 -> from website, not repos.
Comment 1 Kyle Bentley 2012-07-02 09:25:05 UTC
Oops, It should state Ubuntu 12.04 x64.  Sorry for the typo.
Comment 2 Joel Madero 2012-10-19 16:57:02 UTC
Confirmed, this is a weird one ;) Thanks for reporting. Confirming as a bug just because it should be consistent, if this was done on purpose it probably shouldn't have been as charts with a similar mean line should have an identical mean line.

Marking as NEW and prioritizing.

Minor -- does not prevent high quality work, just a visual/aesthetic thing

Lowest -- Easy to still understand the graph, doesn't even really "feel" like a flaw, just inconsistency that you can see if you compare different kinds of charts. Most users (assumed) wouldn't even notice this, and even if they did they wouldn't stop using mean line because of this. 


Potential easy hack. Marking as such
Comment 3 Prashant 2013-03-24 22:39:10 UTC
Hi,
I wish to pick up this bug, explore and work on it. Can someone please help me out wit the code pointers for the same. 

Thanks and Regards,
Prashant
Comment 4 Joel Madero 2013-03-24 23:11:22 UTC
adding Kohei to see if he has any code pointers.

Kohei - any clues?
Comment 5 Markus Mohrhard 2013-03-25 04:37:43 UTC
So let me add a few code pointers:

The main class that handles regression curves and mean value lines is chart2/source/inc/RegressionCurveHelper.hxx

The next important class calculating the mean value lines is at:
chart2/source/tools/MeanValueRegressionCurveCalculator.cxx

And finally the rendering of the line should happen in chart2/source/view/charttypes/VSeriesPlotter.cxx#967. See especially the check in line 1048.

I would start setting a breakpoint in the last mentioned method and check why there is a difference between the two chart types.
Comment 6 Prashant 2013-03-29 15:01:34 UTC
Okay, as far as I could discover, a 'default x-axis shift' is enabled for these three charttypes : Bar, Column and Candlestick which is the root to this bug. 

If I disable that default x-axis shift, these graphs will also start from origin (since no shift will be there now). Scatter and line graphs any-ways start from default origin (no shift is there for them).

I would be happy to know if disabling that shift is sufficient ?
Comment 7 Prashant 2013-03-29 23:39:30 UTC
I found that issue can be solved without disabling the above thing.

Thanks
Prashant
Comment 8 Commit Notification 2013-04-01 20:00:14 UTC
elixir committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=1ed73984639390759d26a2fc0209083d9f984d52

fdo#51656 : Mean value line starts in wrong place in column graph



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 9 Jorendc 2013-04-03 17:09:14 UTC
I can verify it works now. Thanks Prashant for fixing this!

Kind regards,
Joren
Comment 10 Prashant 2013-04-05 17:30:41 UTC
Thanks Joren, for verification and appreciation :)

Regards
Prashant
Comment 11 Robinson Tryon (qubit) 2015-12-15 12:17:15 UTC Comment hidden (obsolete)