Bug 145861 - support for non-contiguous cell ranges
Summary: support for non-contiguous cell ranges
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
7.1.5.2 release
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-11-24 08:21 UTC by Ulrich Windl
Modified: 2021-11-24 21:23 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
WFM: example of using a part of the data as source (18.71 KB, application/vnd.oasis.opendocument.spreadsheet)
2021-11-24 09:32 UTC, Kevin Suo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ulrich Windl 2021-11-24 08:21:47 UTC
It seems non-contiguous ranges are supported in formulas at least, but e.g. not for diagrams.
It would be useful to have one common syntax to specify such ranges and to support those where it makes sense.
That is: What are the occasions where they do NOT make sense?
For a use case see https://superuser.com/q/1689175/964771
Comment 1 Kevin Suo 2021-11-24 09:32:50 UTC
Created attachment 176459 [details]
WFM: example of using a part of the data as source

That is already possible, see the attached example. Is this what you want?

In the "Data Series" tab of the chart wizard, you can define the data range for the "Y Values" and its "Category".
Comment 2 Kevin Suo 2021-11-24 09:39:18 UTC
Steps to use this feature:
1. Open my attached test document, select any cell of the data source;
2. Insert -> Chart, select XY Scatter chart type - points and lines.
3. Next;
4. Next;
5. In "Data ranges" box, click "Y-values". Below that, you see that by default the Range for Y-Values is $工作表1.$B$2:$B$48, and range for Data labels is $工作表1.$A$2:$A$48.
6. Change Range for Y-values to $工作表1.$B$33:$B$48, and Range for Data labels to $工作表1.$A$33:$A$48. Click Finish.

Now you have a chart for February only, rather than for the whole time series.
Comment 3 Timur 2021-11-24 10:11:20 UTC
WFM is when there was unknown fix. 
Of there's an explanation, that's NOTABUG.
Comment 4 Ulrich Windl 2021-11-24 11:50:40 UTC
(In reply to Kevin Suo from comment #1)
> Created attachment 176459 [details]

One comment from the perspective of an European: The Chinese(?) glyphs used in the Data Range makes it hard to read.
Also what I don't understand: Doesn't "$B$1" have to be the first element to make "First row as label" work?
I'll re-check why it did not work for me (cannot access right now).
Comment 5 Kevin Suo 2021-11-24 11:53:24 UTC
工作表1 = Sheet1
Comment 6 Ulrich Windl 2021-11-24 21:23:38 UTC
Confirmed (see also https://superuser.com/a/1689403/964771):
I missed to repeat the table (sheet) identifier when the diagram is on a different sheet, and I missed to include the first row of all header columns.

And to answer comment #4:
> Also what I don't understand: Doesn't "$B$1" have to be the first element to
> make "First row as label" work?

It seems Calc re-orders (sorts) the input, so your selection can only be in-order (row-wise and column-wise) it seems.