Bug 135821 - Copying secondary sheets gives blank/broken graphs
Summary: Copying secondary sheets gives blank/broken graphs
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Sheet
  Show dependency treegraph
 
Reported: 2020-08-17 05:31 UTC by Lyndon Brown
Modified: 2023-05-17 15:06 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
the document in question with which i'm experiencing problems (123.55 KB, application/vnd.oasis.opendocument.spreadsheet)
2020-08-17 05:37 UTC, Lyndon Brown
Details
Result of copying sheets in a certain order (73.77 KB, application/vnd.oasis.opendocument.spreadsheet)
2020-11-14 00:00 UTC, Graham Horner
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Lyndon Brown 2020-08-17 05:31:14 UTC
Description:
i have a recently created document (.ods) with which i've been experiencing problems with empty graphs upon copying sheets.

as discussed below, there appears to be two component issues:

 1. bugs with respect to correctly copying and adjusting chart data attributes.
 2. a graphics glitch with graphs not showing data referenced from another sheet.

let's let this bug report serve for #1, and i'll make a new one for #2 that refers back here for details.

apologies for the large block of text that follows, this took some time to get a handle on, and i've spent a lot of time re-writing it over and over as things developed.

-------

the document i created and experienced problems with is about a week old; it has multiple sheets; each sheet contains graphs, with those graphs only referencing cells of the sheet that they are embedded within. the first sheet was copied (via 'move or copy sheet') to create the second, and the new sheet was adjusted as necessary, including fixing the references of the graphs to point to the cells in the new sheet rather than the original. additional sheets were similarly copied and adjusted from others.

when i created the document i was running version 7.0.0~rc2-1 (on Debian). over the past week or so since then, during which i've edited it, i've updated to 7.0.0-1 and then to 7.0.1~rc1-1.

note that in my testing, unless noted otherwise, i am always asking it to add the new sheet to the end.

-----------

please bare with me...

earlier on during production of the document, i experienced the following issues (of relevance here):

 1. when copying a sheet, the charts (and pivot tables) still referred to the original sheet, requiring manual adjustment (unexpected and time wasting).
 2. there seemed to be a glitch with such charts referencing other sheets, as they would be blank until you changed them to point to the new (current) sheet (containing the graph), saved, closed, and re-opened the document. except if you clicked on the chart, which would temporarily show the lines/bars until you clicked off of it.

#2 was what i was originally coming here to report, while at the same time looking into whether it was possible to change the existing charts to use relative references to make creation of new sheets easier.

however whilst double checking things today in actually putting together a report for #2 (especially since having installed an updated LO in the meantime), things got messy. it seemed that:

 1. a whole new issue had arisen whereby charts would be copied without any data references.
 2. copying of the first sheet in the document however did not exhibit that problem, and in fact behaviour seemed to have changed with the copied sheet now automatically adjusting sheet references to refer to the new sheet.
 3. i was no longer certain whether or not the graphics glitch was still present.

as i experimented more and more whilst writing this report, i discovered that what behaviour you experience can vary depending upon not only which sheet you copy from, but where you choose to place it, and furthermore what actions you have previously taken...

 - initially i was always having the new sheet placed at the back, and experiencing issues of graphs with no data references, except when copying the first sheet, as just described.
 - however i then on a whim tried inserting the copied sheet at the front, which then exhibited the earlier issues, whereby it retained data references, which pointed to the copied from sheet, and showed no data (lines/bars) unless when clicked on. however the glitch only affected the two more complicated (data-series based graphs), while the more simple data-range based ones showed no such glitch (despite definitely referencing the copied-from sheet).

furthermore, having on a whim just copied a sheet to the front and experienced different behaviour, i then copied a sheet to the back again as before, and this time experienced the same alternate behaviour as with copying to the front (data references to the copied-from sheet with graphics glitch).

so there's significant buggy differences from different sheet-copy actions:

 - you may end up with a perfectly copied and reference auto-adjusted graph.
 - you may end up with a graph that's not reference auto-adjusted, thus unexpectedly pointing to the data in the original sheet copied from, and thus experiencing this secondary graphics glitch issue.
 - you may end up with a broken graph that points to nothing at all.

and what you end up with can vary depending upon where you have the new sheet placed in the set, and upon past such choices.

if that weren't messy enough, on a whim i also created a new document and threw a few simple values and a chart in and played with copying sheets, and guess what, everything seemed to work perfectly for it. no matter which sheet i copied and where the new one was placed, the single simple copied graph always referenced data on the new sheet. so why on earth is my original document plagued with issues and this not? i checked a couple of things and it seems to have nothing to do with whether or not graphs are data-range or data-series based, nor whether or not sheet names contain spaces...

------

i'll attach a copy of the primary document in question shortly so you can play with it.

Steps to Reproduce:
i'll attach the document in question, just play with copying sheets and inspecting the graphs that result.

Actual Results:
 

Expected Results:
i'd expect consistent behaviour - specifically, when copying an entire sheet, any references in graphs and pivot tables and such that point to data within the same sheet, should be auto-adjusted in the new sheet to point to the data in the new copied sheet.


Reproducible: Always


User Profile Reset: No


OpenGL enabled: Yes

Additional Info:
Version: 7.0.1.1.0+
Build ID: <buildversion>
CPU threads: 4; OS: Linux 5.7; UI render: default; VCL: gtk3
Locale: en-GB (en_GB.utf8); UI: en-GB
Debian package version: 1:7.0.1_rc1-1
Calc: threaded
Comment 1 Lyndon Brown 2020-08-17 05:37:15 UTC
Created attachment 164364 [details]
the document in question with which i'm experiencing problems
Comment 2 Lyndon Brown 2020-08-17 05:40:58 UTC
geez, so i go to delete one of the experimental copied sheets (happened to be the one at the front, second to last just created), the confirmation dialog pops up, to which i click 'continue' (or whatever), and LO freezes up, my CPU jumps to 100%, and it start getting 'close/wait' dialogs. i kept waiting for a minute or two, but had to just kill it :/
Comment 3 Lyndon Brown 2020-08-17 05:54:02 UTC
just created bug #135822 for the secondary graphics glitch issue.
Comment 4 Graham Horner 2020-11-14 00:00:21 UTC
I can confirm this puzzling behaviour in 6.4.6.2(x64) Win10 2004. It is very difficult to nail down but I can reproduce one of the observed issues as follows:

1. create a single sheet with a chart in it
2. copy the sheet to the end position
3. copy the sheet in the end position to the position before it
4. repeat step 3 a number of times, checking the sheet you just copied. Eventually, double clicking the chart shows the ranges are not in the same sheet as the chart.
5. What's more, some of the other sheets will now no longer have their charts referencing the data in them

In the attached file, everything was sensible until I copied Sheet1_2 to Sheet1_2_6 then:

- Chart in Sheet1_2 is showing data from Sheet1
- Chart in Sheet1_2_6 is showing data from Sheet1
- Chart in Sheet1_2_5 is showing its own data
- Chart in Sheet1_2_4 is showing data from Sheet1_2
- Chart in Sheet1_2_3 is showing data from Sheet1_2
- Chart in Sheet1_2_2 is showing data from Sheet1_2
- Chart in Sheet1 is showing its own data
Comment 5 Graham Horner 2020-11-14 00:00:40 UTC
Created attachment 167291 [details]
Result of copying sheets in a certain order