Bug 118040 - Inadequate error handling in pie charts UI: EDITING the data range can cause the diagram to disappear
Summary: Inadequate error handling in pie charts UI: EDITING the data range can cause ...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
5.4.3.2 release
Hardware: All Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Chart Undo-Redo
  Show dependency treegraph
 
Reported: 2018-06-06 17:45 UTC by Albrecht Müller
Modified: 2019-02-27 09:20 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Albrecht Müller 2018-06-06 17:45:40 UTC
Description:
Innocent looking changes in the data range of a pie chart can make the diagram to disappear. This is pretty surprising, cannot be undone and can lead to data loss.

Steps to Reproduce:
Open a new spreadsheet in Calc. Fill cells A1:A7 with letters A ... G and cells B1:B7 with the numbers 1 ... 7. Using CTRL+Click select cells A1, B1, A3, B3 and A5, B5. Use Insert -> Chart to start the chart wizard. Choose the chart type "Pie".  You should see a pie chart with a legend showing the letters A, C, E. Press "Finish" to close the wizard. Click somewhere outside the newly generated chart. 

Edit the chart - e.g. select the chart again, get the context menu and choose "Edit".  Choose Format -> Data Ranges. Click at the button right to the "Data range" input field. A dialogue box titled "Data Range: Area" appears that allows you to define the data range. Click on Cell B7. The intention is to add an additional entry to the chart. Actually this reduces the range to the single cell B7.

Actual Results:  
The content of the Chart disappears. Press ok. The chart is now a single white rectangle. Click outside this rectangle: The chart is gone. Look at Edit -> Undo: You cannot undo the change that caused the problem, the undo action is "Undo: Insert embedded object (OLE)".

This behaviour caused data loss. I had a speadsheet containing this kind of charts. While entering new data into this document I wanted to include the contents of an additional cell in the chart. After changing the data range accordingly the diagram changed to a white rectangle. Undo did not work. I saw only two options: Save the document in its current state. The diagram is lost. Or: Reload the document without saving. This saves the diagram but discards the data I entered.

Expected Results:
It should be possible to undo the change in the data range to restore old state of the diagram.

The UI should either 
- refuse the change and give a clear reason why it does not accept the change. It also should inform the user about acceptable options for changing data ranges. E.g. it is not possible to change compound data ranges using the mouse selection mechanism? This kind of change requires entering the range in text form.

or

- show some reasonable chart, e.g. one consisting of a single piece for the selected cell in order to allow the user to examine the unintended change.



Reproducible: Always


User Profile Reset: No



Additional Info:
Observed with

Version: 5.4.3.2 (x64) Build ID: 92a7159f7e4af62137622921e809f8546db437e5 CPU threads: 4; OS: Windows 6.1; UI render: default;  Locale: de-DE (de_DE); Calc: group

and

Version: 6.0.4.2 (x64) Build ID: 9b0d9b32d5dcda91d2f1a96dc04c645c450872bf CPU threads: 4; OS: Windows 6.1; UI render: default;  Locale: de-DE (de_DE); Calc: group

BTW: The form I used to submit the bug contains a check box asking if OpenGL is enabled. In the "Options" dialogue I did not find such an option, but there are  OpenCL options. According to my knowledge these are different things. Is this a typo or did I miss LibreOffice's OpenGL options?



User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:60.0) Gecko/20100101 Firefox/60.0
Comment 1 Xavier Van Wijmeersch 2018-06-07 08:23:02 UTC
"It should be possible to undo the change in the data range to restore old state of the diagram.

The UI should either 
- refuse the change and give a clear reason why it does not accept the change. It also should inform the user about acceptable options for changing data ranges. E.g. it is not possible to change compound data ranges using the mouse selection mechanism? This kind of change requires entering the range in text form.

or

- show some reasonable chart, e.g. one consisting of a single piece for the selected cell in order to allow the user to examine the unintended change."

would be a nice improvement, anyone???
Comment 2 Jacques Guilleron 2018-06-07 10:36:28 UTC
Hi Albrecht, Xavier,

Double click on the diagram to edit it, click again on the pie and right click on mouse to select the Data Range. Click on the selection button (at the data right) to minimize it.
Now add a semicolon at the end of the selection. Select the data range to add.
Select OK to validate your choice.
If now you want to undo it:
Edit the pie chart by double clicking on it. Click again to select the datas. you can now used the undo button.
I hope to be clear. Ask questions if this is not the case.
Comment 3 Buovjaga 2018-06-21 18:25:23 UTC
(In reply to Jacques Guilleron from comment #2)
> Hi Albrecht, Xavier,
> 
> Double click on the diagram to edit it, click again on the pie and right
> click on mouse to select the Data Range. Click on the selection button (at
> the data right) to minimize it.
> Now add a semicolon at the end of the selection. Select the data range to
> add.
> Select OK to validate your choice.
> If now you want to undo it:
> Edit the pie chart by double clicking on it. Click again to select the
> datas. you can now used the undo button.
> I hope to be clear. Ask questions if this is not the case.

Albrecht: waiting for your comments.
Comment 4 Albrecht Müller 2018-06-25 19:00:09 UTC
@Jacques Guilleron:  After the loss of the diagram I spent some time to analyse the problem and found out how I can fix the problem and avoid the loss of data. I think my solution is roughly equivalent to your solution.

I described the experience of a user who does not have this knowledge: You do a little change, the diagram is gone, no way to undo the change. The key problem is that you do not notice that actually the diagram is still there but you don't see it. If you are lucky you may notice that some parts of gridlines are missing. If View -> Gridlines for Sheet if off you cannot see this hint.

From a pure technical point of view there is no real data loss and you can undo the change. On the other hand a user may not be aware that the invisible diagram is still there. Therefore this user is likely to do actions that cause the loss of data.
Comment 5 Xisco Faulí 2018-12-27 09:25:49 UTC
Hello Albrecht,
A new major release of LibreOffice is available since this bug was reported.
Could you please try to reproduce it with the latest version of LibreOffice
from https://www.libreoffice.org/download/libreoffice-fresh/ ?
I have set the bug's status to 'NEEDINFO'. Please change it back to
'UNCONFIRMED' if the bug is still present in the latest version.
Comment 6 Roman Kuznetsov 2019-02-26 18:25:24 UTC
(In reply to Albrecht Müller from comment #0)
> Description:
> Innocent looking changes in the data range of a pie chart can make the
> diagram to disappear. This is pretty surprising, cannot be undone and can
> lead to data loss.
> 
> Steps to Reproduce:

...

> A dialogue box titled "Data Range: Area"
> appears that allows you to define the data range. Click on Cell B7. The
> intention is to add an additional entry to the chart. Actually this reduces
> the range to the single cell B7.
 
It's expected behavior, because after pressing of button "Select data range" you see full selected address in minidialog window and if you select any cell on sheet at once then you change all selected adress to new. You should before selecting of any cell on sheet just click in adress line in minidialog to deselect address.

> Actual Results:  
> The content of the Chart disappears. Press ok. The chart is now a single
> white rectangle. Click outside this rectangle: The chart is gone. Look at
> Edit -> Undo: You cannot undo the change that caused the problem, the undo
> action is "Undo: Insert embedded object (OLE)".

And it's a bug because you can't make Undo operation after disappearing of chart and you loss your chart.
You should use Undo function in Chart edit mode at once after changing of data range.

Resume: Undo function should remember all user actions in one main list. Now we have two different Undo list: first - main, for all sheet and second - in Chart edit mode

And finally: still repro in

Version: 6.3.0.0.alpha0+
Build ID: b45289e48e0f354b9996e2846dd041db4a9947ce
CPU threads: 4; OS: Linux 4.18; UI render: default; VCL: kde5; 
TinderBox: Linux-rpm_deb-x86_64@86-TDF, Branch:master, Time: 2019-02-08_12:51:03
Locale: ru-RU (ru_RU.UTF-8); UI-Language: en-US
Calc: threaded