Bug 42196 - Automatically extend the chart data source range when adding rows at the end
Summary: Automatically extend the chart data source range when adding rows at the end
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Chart (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL: https://ask.libreoffice.org/t/problem...
Whiteboard:
Keywords: needsDevAdvice
: 47584 (view as bug list)
Depends on:
Blocks: Calc-DataRange
  Show dependency treegraph
 
Reported: 2011-10-25 04:02 UTC by Thomas Bertels
Modified: 2023-09-13 01:47 UTC (History)
7 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 Thomas Bertels 2011-10-25 04:02:29 UTC
Say that we create a chart with a defined data source.
Then we add rows to the data source.

LibreOffice should detect this and whether ask us if we want to add the rows to the chart or do it automatically.
Comment 1 sasha.libreoffice 2012-04-17 03:35:34 UTC
Thanks for bugreport
in 3.5.2 with adding rows this works
with columns not works, but it makes not much sense
Please, tell if existing functionality not enough
Comment 2 Thomas Bertels 2012-04-17 05:34:53 UTC
I can't seem to make it work here.

Here's what I do:

- Enter theses data:
1, 2, 3 in the first column (cells A1-A3).
10, 20, 30 in the second column (cells B1-B3).
- Create a chart with these data.
- Click on cell A4.
- Enter these data:
4 in cell A4
40 in cell B4

Results:
The chart data source doesn't get updated to include row 4.

Note that it should also extend the data source if I were to either:
- drag/paste the data from row 3 to row 4 instead of inserting a line.
- insert a row after clicking on cell A4.
Comment 3 sasha.libreoffice 2012-04-18 02:56:26 UTC
Thanks for additional information. So we have several bug. 
Sorry for may previous comment. I confused rows and columns.
Steps to reproduce:
0. Start Calc and enter these information:
> 1, 2, 3 in the first column (cells A1-A3).
> 10, 20, 30 in the second column (cells B1-B3).
> - Create a chart with these data.
1. enter 4 and 40 in row 4
Expected: row 4 included into chart
Actually: nothing happens
IMHO it is functionality request for adding such functionality. Will be useful for creating chart when all data on sheet intended for diagram. Will create problem when when on sheet is another information. Therefore should be option for disable/enable this functionality.

2. place cursor in cell B2 , right mouse click, "Insert" from context menu, "Entire row"
Expected: new row included into chart
Actually: not included.
The same situation by inserting rows by another means. It is another bug or functionality request.

3. Select column A or content of it
4. place cursor in B1 and use Paste Special, select option "Shift right"
Expected: new column included into chart
Actually: not included.
It is a bug. When we insert column by other means, new column included.
Comment 4 QA Administrators 2015-02-19 15:38:23 UTC Comment hidden (obsolete)
Comment 5 Thomas Bertels 2015-02-19 17:12:37 UTC
No change with version 4.4.0.3 on Windows 7 x64.
Comment 6 QA Administrators 2016-02-21 08:36:59 UTC Comment hidden (obsolete)
Comment 7 Stéphane Guillou (stragu) 2016-02-22 10:02:50 UTC
Just tested this in 5.0.5.2 (Build ID: 1:5.0.5~rc2-0ubuntu1~trusty1)

Bug is still present, but behaviour differs from comment 3. Inserting a row does add the data to the chart's data range. However, here are the issues that remain:

1. Adding data below the range does not add it to the chart automatically

2. Inserting a column does not add the data to the data range

IMHO, I do not think the first one is a bug. The second one definitely is as the behaviours differ between columns and rows, and most users would expect inserted data to be added to the range.
Comment 8 QA Administrators 2017-03-06 15:40:44 UTC Comment hidden (obsolete)
Comment 9 Stéphane Guillou (stragu) 2017-03-07 03:11:11 UTC
Testing with KXStudio 14.04, LO details as follow:

Version: 5.2.5.1
Build ID: 1:5.2.5~rc1-0ubuntu1~trusty0
CPU Threads: 2; OS Version: Linux 3.13; UI Render: default; VCL: gtk2; 
Locale: en-GB (en_GB.UTF-8); Calc: group

Here is what I see:

Data *will* be added if the data series range is extended by adding cells inside it:
- If data series are in columns, adding a row inside the range will include the new data.
- If data series are in rows, adding a column inside the range will include the new data.

New data will *not* be added if a row or column is added *outside* the ranges of the data series, i.e. if a column is added between two columns of data series, or before or after them; or if a row is added between two row of data series, or above or under them.
Similarly, if we add data under or above the ranges, it will not be automatically extended.

I now think that the current behaviour is consistent and expected, and believe that this bug should be closed. But I'd like to hear back from others first.

If there is a more specific issue, maybe a new bug should be opened as it seems that we have been talking about a few different issues in the comments. (For example, if you think that writing data next to an outer edge of a data series range should automatically extend the boundaries, please open a new specific report.)
Comment 10 Thomas Bertels 2017-03-07 10:21:49 UTC
I thought that Excel did it, but I just tested it and it doesn't.
However, Google Sheets does it automatically whether we insert a row at the end of the range or we just add values in rows at the end of the range (not at the start).

Anyway, I think LO should at least suggest us to automatically extend the range.

But it probably can't be considered a bug, so I'm switching it to enhancement.
Comment 11 Stéphane Guillou (stragu) 2017-03-07 20:16:14 UTC
Thomas, you might want to reword the title to be more specific then.
Comment 12 Thomas Bertels 2017-03-09 14:43:44 UTC
Following your suggestion, I changed the title. If you have a better idea, just tell me.
Comment 13 m_a_riosv 2021-05-14 00:28:22 UTC
Inserting rows at the end (not only adding data) works if Menu/Tools/Options/LibreOffice calc/General - Expand references when new rows/columns are added.

But I agree it should detect adding data.
Comment 14 Stéphane Guillou (stragu) 2022-12-16 19:12:47 UTC
*** Bug 47584 has been marked as a duplicate of this bug. ***
Comment 15 Heiko Tietze 2022-12-19 16:49:05 UTC
I used to add rows at the beginning, don't want to scroll down. But inserting a row moves the data range down one row. Do we need to detect this too? In other words what action is accepted as extending the data range and when does such a convenience function fail?
Comment 16 m_a_riosv 2022-12-21 22:50:03 UTC
There are a lot of questions in the forum about this matter.
https://ask.libreoffice.org/search?q=chart%20range%20%23english
Comment 17 Heiko Tietze 2022-12-22 09:57:06 UTC
The topic was on the agenda of the design meeting but didn't receive further input.

To summarize: Inserting a row between start/end adds it to the data range; before start or after the end does not unless the option "Expand references when new rows/columns are added" is checked. Adding data to the end is usually done without adding a row and should be detected. And we should consider to enable SID_SC_INPUT_REF_EXPAND by default => needsDevAdvice whether this bears any harm.