Bug 159419 - Amount and Range chart (StockChart3) corrupted after save and reload (series shift if categories are multi-column)
Summary: Amount and Range chart (StockChart3) corrupted after save and reload (series ...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: x86-64 (AMD64) All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Chart
  Show dependency treegraph
 
Reported: 2024-01-28 21:25 UTC by gekacheka
Modified: 2024-02-04 14:36 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
ods spreadsheet with data for steps to reproduce (16.97 KB, application/vnd.oasis.opendocument.spreadsheet)
2024-01-28 21:30 UTC, gekacheka
Details
image of created default chart before save (53.22 KB, image/png)
2024-01-28 21:32 UTC, gekacheka
Details
image of corrupted chart (after save and reload) (45.52 KB, image/png)
2024-01-28 21:33 UTC, gekacheka
Details
image of corrupted chart (after save and reload) (47.05 KB, image/png)
2024-01-28 21:37 UTC, gekacheka
Details
Sample document with chart created with OOo 3.3. (19.55 KB, application/vnd.oasis.opendocument.spreadsheet)
2024-01-29 01:21 UTC, Stéphane Guillou (stragu)
Details
sample ODS, simplified (11.03 KB, application/vnd.oasis.opendocument.spreadsheet)
2024-01-29 04:00 UTC, Stéphane Guillou (stragu)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description gekacheka 2024-01-28 21:25:15 UTC
Description:
Amount and Range chart (StockChart3) corrupted after save and reload.


Steps to Reproduce:
1. Open stockchart3-save-reload-bug-data.ods
2. Select range $A$1:$E$15
3. Menu: Insert / Chart ... 
4. Click Stock chart type, the select Stock Chart 3, and click Finish button.
5. Move the chart off the data.
At this point chart looks something like stockchart3-default-before-save.png

Given data with columns datetime, day-of-week, kW/h, Lo, Hi
Selecting all data and inserting a chart, choosing Stock Chart 3 nicely uses 
- datetime and day-of-week for x axis labels, 
- kW/h for amount
- Lo temperature for low value of range
- Hi temperature for high value of range

6. File / Save
7. File / Reload

Actual Results:
Now chart looks something like stockchart3-after-save-and-reload.png

Save and reload corrupted chart
- only date of datetime is used for x axis, hour is lost
- day of week column is not used for x axis
- left y-axis range is incorrect, not obviously related to any data column
- right y-axis range is incorrect, not obviously related to any data column
- plotted data is incorrect


Expected Results:
Chart still looks like stockchart3-default-before-save.png


Reproducible: Always


User Profile Reset: Yes

Additional Info:
Version: 7.6.4.1 (X86_64) / LibreOffice Community
Build ID: e19e193f88cd6c0525a17fb7a176ed8e6a3e2aa1
CPU threads: 8; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: threaded
Comment 1 gekacheka 2024-01-28 21:30:24 UTC
Created attachment 192210 [details]
ods spreadsheet with data for steps to reproduce
Comment 2 gekacheka 2024-01-28 21:32:28 UTC
Created attachment 192211 [details]
image of created default chart before save
Comment 3 gekacheka 2024-01-28 21:33:45 UTC Comment hidden (obsolete)
Comment 4 gekacheka 2024-01-28 21:37:52 UTC
Created attachment 192213 [details]
image of corrupted chart (after save and reload)

(replaces wrong image; 192211 included some axis customization before reload)
Comment 5 Stéphane Guillou (stragu) 2024-01-29 01:21:25 UTC
Created attachment 192223 [details]
Sample document with chart created with OOo 3.3.

Reproduced with:

Version: 24.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 2cedb1a19ad605df4e148589e9027512e4dd9265
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

and:

Version: 6.0.0.3
Build ID: 64a0f66915f38c6217de274f0aa8e15618924765
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk2; 
Locale: en-AU (en_AU.UTF-8); Calc: group

Following the steps with OOo 3.3 does not create the same chart as it didn't do as much automatic guessing of series back then. However, using the same chart settings, the chart does not get mangled on save and reload. Attached is such a file. Interestingly, this file opened with a recent version, saved and reloaded, does not exhibit the bug.

The issue seems to be with the data range including row labels that span two columns. It works are first, but on save and reload, only one column is used for categories, everything else is shifted to the left, and the last column is used for "Close Values" when it wasn't populated before.
Comment 6 Stéphane Guillou (stragu) 2024-01-29 01:29:28 UTC
Not reproduced if the "day of the week" column is deleted.
Comment 7 gekacheka 2024-01-29 03:07:11 UTC
For me, after deleting the day of week (DoW) column and recreating chart:

* It is true that save/reload doesn't change the chart in that case.

* The chart has some problems that the original spreadsheet had only after reload.
- only date of datetime is used for x axis, hour is lost
- the right y-axis range 0 to 16 is incorrect, not obviously related to any column
  (not range of Lo and Hi temperatures, -15 to 5.
   maybe offset range of Lo values only, -15 to 1.)

Maybe those should be separate bug report(s)?

Version: 7.6.4.1 (X86_64) / LibreOffice Community
Build ID: e19e193f88cd6c0525a17fb7a176ed8e6a3e2aa1
CPU threads: 8; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: threaded

(In reply to Stéphane Guillou (stragu) from comment #6)
> Not reproduced if the "day of the week" column is deleted.
Comment 8 Stéphane Guillou (stragu) 2024-01-29 04:00:28 UTC
Created attachment 192228 [details]
sample ODS, simplified

Actually, the behaviour is inherited from OpenOffice 3.3.
The difference I was seeing in comment 5 was due to SWITCH() in the DoW column not being supported prior to LO 5.2.[1]

Repeating the steps with the simpler attached document (no linked data, no formula in DoW column), I can reproduce the shift in data ranges after save + reload in OOo 3.3.

[1]: https://wiki.documentfoundation.org/ReleaseNotes/5.2#New_spreadsheet_functions
Comment 9 Stéphane Guillou (stragu) 2024-01-29 04:03:40 UTC
(In reply to gekacheka from comment #7)
> * The chart has some problems that the original spreadsheet had only after
> reload.
> - only date of datetime is used for x axis, hour is lost
> - the right y-axis range 0 to 16 is incorrect, not obviously related to any
> column
>   (not range of Lo and Hi temperatures, -15 to 5.
>    maybe offset range of Lo values only, -15 to 1.)
> 
> Maybe those should be separate bug report(s)?
Yes please, unless they have already been reported. For example, the first problem might already be tracked in bug 68679.
Comment 10 gekacheka 2024-02-04 14:36:26 UTC
Reported y-axis range problem in bug 159550.