Bug 66250 - Use a Named range as data source for Chart
Summary: Use a Named range as data source for Chart
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard: target:7.3.0
Keywords:
: 132647 (view as bug list)
Depends on:
Blocks: Chart-Enhancements Chart-Data Cell-Name
  Show dependency treegraph
 
Reported: 2013-06-27 10:28 UTC by Pedro
Modified: 2021-08-23 10:29 UTC (History)
9 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 Pedro 2013-06-27 10:28:47 UTC
This has been a long standing limitation in OOo and now LO.

You can use Named ranges as source for Pivot tables but not for charts. 

This would allow to have charts defined for later data input (currently that is not possible because the data range is automatically reduced to cells containing data)

See this topic as an example (there are many others)
http://ask.libreoffice.org/en/question/19627/calc-charts-automatically-increasing-data-range/
Comment 1 Owen Genat (retired) 2014-07-05 00:57:45 UTC
Added related Apache OO issue to See Also list. Version set to Inherited from OOo.
Comment 2 Owen Genat (retired) 2014-07-05 01:34:51 UTC
A workaround is to select an additional empty row (above and below) for the Data Range and ensure this option is selected: 

Tools > Options > LibreOffice Calc > General > Input Setting > Expand references when new columns/rows are inserted

Inserting a new row beneath the last row will then automatically update the chart as expected. Same effect if inserting a new row prior to first row of data.
Comment 3 Pedro 2014-07-05 06:39:20 UTC
(In reply to comment #2)
> Inserting a new row beneath the last row will then automatically update the
> chart as expected. Same effect if inserting a new row prior to first row of
> data.

Thanks. I already do that. But I hope that someone actually adds this feature. It doesn't make sense that you can use Named ranges for some features but not for others. It's inconsistent and unintuitive ;)
Comment 4 Regina Henschel 2016-02-20 18:53:11 UTC
This issue is connected to bug 64086. The missing ODF feature is handled in https://issues.oasis-open.org/browse/OFFICE-2081
Comment 5 Timur 2020-05-04 02:00:36 UTC
*** Bug 132647 has been marked as a duplicate of this bug. ***
Comment 6 Ulrich Windl 2020-12-21 20:15:20 UTC Comment hidden (no-value)
Comment 7 Commit Notification 2021-08-09 17:33:34 UTC
Balazs Varga committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/233286df08aeedb4e228fd523365b94543b16fca

tdf#64086 tdf#143623 tdf#66250 XLSX: fix named ranges in charts

It will be available in 7.3.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 8 NISZ LibreOffice Team 2021-08-10 07:28:47 UTC
Verified in:

Version: 7.3.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: eeeef98796df322d89912070c8e431c5f6d1283f
CPU threads: 4; OS: Windows 10.0 Build 17134; UI render: Skia/Raster; VCL: win
Locale: hu-HU (hu_HU); UI: hu-HU
Calc: threaded
Comment 9 Timur 2021-08-10 07:56:24 UTC
Please add to https://wiki.documentfoundation.org/ReleaseNotes/7.3.
Comment 10 Alexander Kriegisch 2021-08-21 11:32:29 UTC
I was waiting for this feature for around 15 years. This was the main knock-out criterion for me to not use OpenOffice and later LibreOffice, because I heavily rely on named ranges in Excel for auto-updating charts. So I was excited to see that this is suppoed to be fixed now.

I tried to import some of my old Excel XLS files and was disappointed to see no effect whatsoever. Then I inspected the Git commit and saw that the change seems to affect only XSLX import. My Microsoft 365 subscription lately having expired, I had to ask a friend to convert the files to XSLX for me. I re-tested, and I can see the charts now.

Question: Was XLS import ignored on purpose or is that format somehow not being supported first-class anymore?

Issues: If I change data in the table, the diagram is never updated. If I want to edit the chart's data ranges, I get an error message asking me if I want to create new ones because the existing ones are based on an internal table (sorry, the message is in German on my system).

From my perspective, this feature is not fully implemented yet. The idea was to get support for dynamic data ranges, not a static snapshot copy of data. If I want static charts, I do not need dynamic named ranges in the first place. I suggest to reopen the issue.
Comment 11 Timur 2021-08-21 20:25:09 UTC
(In reply to Alexander Kriegisch from comment #10)
> Question: Was XLS import ignored on purpose or is that format somehow not
> being supported first-class anymore?
LO is volunteer based and devs choose what they do. Nisz, which resolved this, is contributing to OOXML. 
Xlsx and Xls are different filters and we usually open different bugs. So, please open a bug for Xls and link to bug 64086.
Comment 12 Timur 2021-08-23 10:29:42 UTC
Upon testing, I see this:
1. named ranges from XLSX are imported and saved (bug 64086);
2. named range are updated correctly if we modify the values in cells;

*but* the following issues remain for new bugs:

3. if we create chart with data including named range, they will not be used automatically (as in MSO where cell reference in the formula will change to their defined names automatically); 
4. if we change the Named range, the chart is not updated;
5. named ranges are not exported in ODS;
6. named ranges are opened for XLS but lost when saving to XLS, so chart on reopen is wrong.