| Summary: | chart upper Y bound is 1.2 when real range upper bound is 1 | ||
|---|---|---|---|
| Product: | LibreOffice | Reporter: | Mark <musicman> |
| Component: | Chart | Assignee: | Not Assigned <libreoffice-bugs> |
| Status: | RESOLVED WONTFIX | ||
| Severity: | enhancement | ||
| Priority: | medium | ||
| Version: | 6.2.8.2 release | ||
| Hardware: | x86-64 (AMD64) | ||
| OS: | Linux (All) | ||
| Whiteboard: | |||
| Crash report or crash signature: | Regression By: | ||
| Attachments: |
The maximum on the chart isn't the true maximum value.
Percent-stacked chart, max is correct at 100% 3D look, chart max is 1 which is correct Percent-stacked, 3D look, max is 1 which is correct, also looks very similar to previous attachment |
||
|
Description
Mark
2020-09-23 01:52:43 UTC
Created attachment 166476 [details]
The maximum on the chart isn't the true maximum value.
This screenshot was done following the "steps to reproduce" I outlined above.
LibreOffice version: 7.0.2.2
This is as designed. The automated axis configuration leaves a buffer around the value so that it is not too close to the boundaries of the chart. If you want to remove this buffer, you have to manually configure the axis minimum and maximum. I would be very interested to read the design document, or the online discussion, about such a visual buffer. And as a counterpoint, the same two values (in the instructions to reproduce) can be plotted as a "percent stacked" chart, with no visual buffer, and it's just as effective. It's the 3rd type of vertical bar chart, in the same dialog.
And, checking the "3D Look" box, with the regular vertical bar chart style, renders a 3D chart, with the chart maximum at 1, not 1.2. In fact, the 3D vertical bar and 3D stacked percentage charts look nearly identical, the only difference being the vertical axis values ("1" vs. "100%") and chart rendering adjustments related to the same text.
I will attach screenshots to demonstrate all these.
Created attachment 168731 [details]
Percent-stacked chart, max is correct at 100%
Created attachment 168732 [details]
3D look, chart max is 1 which is correct
Created attachment 168733 [details]
Percent-stacked, 3D look, max is 1 which is correct, also looks very similar to previous attachment
The best way if you want to understand better what is going on is to look at the code: https://github.com/LibreOffice/core/blob/90cc24d4728dc94a30865d3b3af9409d5967b45a/chart2/source/view/axes/ScaleAutomatism.cxx#L923 You can see that the additional space is mentioned in the comment, it is explicitly calculated and not a side effect or a bug. When starting from 0, if the max value is more that the largest tick * 20/21 (so "too close" to the top), another gradation is added. In your example, if the largest value is more than 20/21=0.9539095... then the maximum will be 1.2 and not 1. It has been like this since at least 2007 (code history is more difficult to get before that). Thanks for your quick reply. So this behavior is at least 13 years old. I've explored further with miscellaneous small values in A1 and B1. I'm guessing that I've never created a chart with sufficiently small values to expose it. As much as I'd like to consider some enhancement(s) for calculating the default min/max chart ranges, the user can already override the defaults with explicitly stated ranges, as you said. Therefore, I'm marking as WONTFIX since it's nothing that needs to be fixed. |