Bug 146066 - Vertical axis automatic scaling is wrong for some label column values
Summary: Vertical axis automatic scaling is wrong for some label column values
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Chart (show other bugs)
Version:
(earliest affected)
7.0.0.3 release
Hardware: All Windows (All)
: medium normal
Assignee: Tünde Tóth
URL:
Whiteboard: target:7.4.0 target:7.3.1
Keywords: bibisected, bisected, regression
: 147073 (view as bug list)
Depends on:
Blocks: Chart
  Show dependency treegraph
 
Reported: 2021-12-05 20:49 UTC by Hernan
Modified: 2022-02-14 07:41 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
sample file (15.69 KB, application/octet-stream)
2021-12-06 02:57 UTC, Hernan
Details
screenshot (60.61 KB, image/jpeg)
2021-12-06 02:57 UTC, Hernan
Details
screenshot2 (45.61 KB, image/png)
2021-12-06 11:08 UTC, Hernan
Details
test sample 2 (16.45 KB, application/vnd.oasis.opendocument.spreadsheet)
2021-12-06 11:08 UTC, Hernan
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Hernan 2021-12-05 20:49:56 UTC
Description:
A line graph fails to use the correct axis automatic scale when the first colum (labels) are date values. 
The problem does not ocurr for column graphs or other colum labels

Steps to Reproduce:
1. On a blank Calc sheet, create a first column (A1:A7) with dates (I've used 2021-05-15, 2021-06-15 ... ), format as MM-AA
2. Create a second column (B1:B7) with the numbers (20, 10, 20, 30, 20, 20, 40)
3. Select filled cells, insert graph: select line type (problem is already visible in the preview of the Chart wizard: the chart is cropped)
4. In the second step of the wizard, select defaults: "Data series in columns / First column as label" . Click Finish.

Actual Results:
The Vertical axis (with default auto scaling) extends up to 35, the chart is cropped.

Expected Results:
The vertical axis should extend to 40 or more.


Reproducible: Always


User Profile Reset: Yes



Additional Info:
The problem goes away if the chart type is changed to column.
Or if the first column values are deleted (or replaced by numbers or strings).
Comment 1 Hernan 2021-12-05 21:24:34 UTC
Correction: in step 1 above, date format should be "MM-YYYY"
Comment 2 Hernan 2021-12-05 23:50:58 UTC
Additional Info:
Version: 7.2.2.2 (x64) / LibreOffice Community
Build ID: 02b2acce88a210515b4a5bb2e46cbfb63fe97d56
CPU threads: 6; OS: Windows 10.0 Build 19043; UI render: Skia/Raster; VCL: win
Locale: es-AR (es_AR); UI: en-US
Calc: CL
Comment 3 m_a_riosv 2021-12-06 02:53:54 UTC
Please attach a sample file.
Comment 4 Hernan 2021-12-06 02:57:05 UTC
Created attachment 176718 [details]
sample file
Comment 5 Hernan 2021-12-06 02:57:39 UTC
Created attachment 176719 [details]
screenshot
Comment 6 Hernan 2021-12-06 03:00:16 UTC
In case this is relevant: in bug 146067 I report another issue that manifests when labels used for the X axis are dates.

https://bugs.documentfoundation.org/show_bug.cgi?id=146067
Comment 7 Hernan 2021-12-06 03:03:51 UTC
ddionally: the problem ocurrs only if 40 (the maximum value) is the last value in the series.

If we change the series 

(20, 10, 20, 30, 20, 20, 40)

to

 (20, 10, 20, 40, 20, 20, 30)

all is fine.

(This now looks to me a litte more related to issue 146067)
Comment 8 m_a_riosv 2021-12-06 03:33:43 UTC
Yes, it happens when the last value of range it's the highest value.
Extended the range, even with a blank row, makes it works properly.

Version: 7.2.4.1 (x64) / LibreOffice Community
Build ID: 27d75539669ac387bb498e35313b970b7fe9c4f9
CPU threads: 4; OS: Windows 10.0 Build 21390; UI render: Skia/Raster; VCL: win
Locale: es-ES (es_ES); UI: en-US Calc: CL
Version: 7.4.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: 4ac9032163cf55c160145373e7c41741c9c339ca
CPU threads: 4; OS: Windows 10.0 Build 21390; UI render: Skia/Raster; VCL: win
Locale: es-ES (es_ES); UI: en-US Calc: CL
Comment 9 Hernan 2021-12-06 11:06:51 UTC
Additional fact (also seems to apply to https://bugs.documentfoundation.org/show_bug.cgi?id=146067 ):

All is right if the last date is on the first day of month (2021-11-1 instead of 2021-11-15)

It seems that the problem is actually in the automatic range calculation of the X-axis: it assumes (2021-05-01, 2021-11-01)  even if the last value is 2021-11-15

ADding new test sample and screenshot
Comment 10 Hernan 2021-12-06 11:08:16 UTC
Created attachment 176728 [details]
screenshot2

shows that the problem seems to lie in the x-axis automatic range calculation
Comment 11 Hernan 2021-12-06 11:08:42 UTC
Created attachment 176729 [details]
test sample 2
Comment 12 Gabor Kelemen (allotropia) 2021-12-06 14:13:59 UTC
This started in 7.0 with:

https://git.libreoffice.org/core/+/ed2c880a691a0b179bbc92a8ce4ee49eac004035

author	Tünde Tóth <tundeth@gmail.com>	Thu May 21 10:20:43 2020 +0200
committer	László Németh <nemeth@numbertext.org>	Mon May 25 13:41:49 2020 +0200
tree 40fae66a1dc0b237c31d881a25552d4bb8b506cd
parent 7ed0993b9c2de38dfe2e71df15755b495f9a2299 [diff]

tdf#133005 Chart: fix ODF import of date axis position

Adding CC to: Tünde Tóth
Comment 13 Commit Notification 2022-01-31 15:07:41 UTC
Tünde Tóth committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/81abc0d7657f194804681415a786627ab71475e3

tdf#146066 chart: fix automatic axis scaling at dates

It will be available in 7.4.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 14 Commit Notification 2022-02-01 08:42:01 UTC
Tünde Tóth committed a patch related to this issue.
It has been pushed to "libreoffice-7-3":

https://git.libreoffice.org/core/commit/dca425203c0205a6c570fa36f0dfdfa078960249

tdf#146066 chart: fix automatic axis scaling at dates

It will be available in 7.3.1.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 15 Leyan 2022-02-07 07:18:34 UTC
*** Bug 147073 has been marked as a duplicate of this bug. ***
Comment 16 NISZ LibreOffice Team 2022-02-14 07:41:03 UTC
Verified in:
Version: 7.4.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: 42c5506a9e9ef58efd8193a193464e3b49d481ca
CPU threads: 4; OS: Windows 10.0 Build 18363; UI render: Skia/Raster; VCL: win
Locale: hu-HU (hu_HU); UI: hu-HU
Calc: threaded