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:
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
LO 188.8.131.52 -> from website, not repos.
Oops, It should state Ubuntu 12.04 x64. Sorry for the typo.
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
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,
adding Kohei to see if he has any code pointers.
Kohei - any clues?
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:
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.
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 ?
I found that issue can be solved without disabling the above thing.
elixir committed a patch related to this issue.
It has been pushed to "master":
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:
Affected users are encouraged to test the fix and report feedback.
I can verify it works now. Thanks Prashant for fixing this!
Thanks Joren, for verification and appreciation :)
Migrating Whiteboard tags to Keywords: (EasyHack DifficultyBeginner SkillCpp SkillDebug )