Bug 146463 - Filtering of data series name does not hide it in chart legend
Summary: Filtering of data series name does not hide it in chart legend
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
7.1.0.0.beta1+
Hardware: All All
: medium normal
Assignee: Leyan
URL:
Whiteboard: target:7.4.0 target:7.3.2 target:7.2.7
Keywords: bibisected, bisected, regression
Depends on:
Blocks: AutoFilter Chart-Legends
  Show dependency treegraph
 
Reported: 2021-12-29 05:36 UTC by Leo Moons
Modified: 2022-03-03 22:20 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:
Regression By:


Attachments
Data with diagram and 2 filters (31.16 KB, application/vnd.oasis.opendocument.spreadsheet)
2022-01-12 20:44 UTC, Leo Moons
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Leo Moons 2021-12-29 05:36:57 UTC
Description:
Applying a filter in the data is reflected in the diagram, but the filter is not applied in the legend
 

Steps to Reproduce:
1. I have a table of about 60 rows and 100 columns.
2. I then add an AutoFilter for the first column.
3. I make a diagram from this table of all data.
4. I apply the filter and have filtered 10 rows.

Actual Results:
The data for the 10 rows are represented in the diagram, but the legend still shows the 60 labels of the first column

Expected Results:
Legend should only show the 10 filtered labels


Reproducible: Always


User Profile Reset: Yes



Additional Info:
It seems to be a regression as it did not appear in version 6.4
Comment 1 stragu 2021-12-29 14:33:20 UTC Comment hidden (obsolete)
Comment 2 Leo Moons 2022-01-12 20:44:35 UTC
Created attachment 177503 [details]
Data with diagram and 2 filters
Comment 3 Leo Moons 2022-01-12 20:46:25 UTC
Hi Stéphane,

Many thanks for taking up this matter. I have attached a spreadsheet with some data and a diagram. I have added a filter to columns A and B. When I filter out an item in either column A or B, the diagram shows the filtered out data, but the legend shows all the data and is not filtered according the AutoFilter.
Fyi I have also included the version details from LO and my OS in the spreadsheet.
Should you need more clarification, feel free to contact me
Comment 4 stragu 2022-01-13 01:30:47 UTC Comment hidden (obsolete)
Comment 5 stragu 2022-01-13 01:35:59 UTC
Also confirmed with:

Version: 7.3.0.1 / LibreOffice Community
Build ID: 840fe2f57ae5ad80d62bfa6e25550cb10ddabd1d
CPU threads: 8; OS: Linux 5.4; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

Note that this works as expected when the name is in only one column: both the line and the legend disappear when the data series name is filtered out.
So this issue is related to the fact that the name range for one single data series goes across several cells. Filter out a part of the range, or even the whole range, still doesn't get rid of the legend item.
Definitely something that should be fixed, in my opinion.
Comment 6 stragu 2022-01-13 01:44:18 UTC
It's a regression. I could not reproduce in:

Version: 7.0.6.2
Build ID: 00(Build:2)
CPU threads: 8; OS: Linux 5.4; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Ubuntu package version: 1:7.0.6-0ubuntu0.18.04.1_lo1
Calc: threaded

But I could reproduce with:

Version: 7.1.8.1 / LibreOffice Community
Build ID: e1f30c802c3269a1d052614453f260e49458c82c
CPU threads: 8; OS: Linux 5.4; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

Wondering if it has anything to do with autofilter performance improvements that made it into LO 7.2: fixes for bug 133878 and bug 122419
Comment 7 raal 2022-01-15 05:29:25 UTC
This seems to have begun at the below commit.
Adding Cc: to Ouyang Leyan ; Could you possibly take a look at this one?
Thanks
 92fd09082bfc865edc4c44cf3167af61cad36e32 is the first bad commit
commit 92fd09082bfc865edc4c44cf3167af61cad36e32
Author: Jenkins Build User <tdf@pollux.tdf>
Date:   Thu Nov 26 19:56:39 2020 +0100

    source sha:fd5f3b212a38ec6ef35d2686ce5a7cc39cb7d377

https://git.libreoffice.org/core/+/fd5f3b212a38ec6ef35d2686ce5a7cc39cb7d377
  tdf#134059 Always include hidden cells in chart series label
Comment 8 Leyan 2022-01-16 12:57:45 UTC
It is indeed due to the change I made last year for tdf#134059. We wanted to see the label content even if the label cell is hidden, so from the chart point of view, the label is now never hidden. However, we still checked whether the label was hidden or not to decide if the legend should display the timeseries, so the legend always contained all the data series.

I submitted a patch to resolve this: https://gerrit.libreoffice.org/c/core/+/128476
Comment 9 Commit Notification 2022-02-28 08:27:48 UTC
Ouyang Leyan committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/7c5cfe54357e4e8d08b4696e80741097d3335dcb

tdf#146463 Apply data series filter to the chart legend

It will be available in 7.4.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 10 Commit Notification 2022-02-28 11:17:03 UTC
Ouyang Leyan committed a patch related to this issue.
It has been pushed to "libreoffice-7-3":

https://git.libreoffice.org/core/commit/73e443d32d5c275da953c29f4c493ff565426e8d

tdf#146463 Apply data series filter to the chart legend

It will be available in 7.3.2.

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 11 Commit Notification 2022-02-28 16:46:07 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/97ca239014e50d26bb2553ebeb96e0bc57e27d2d

tdf#146463: chart2_import2: Add unittest

It will be available in 7.4.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 12 Commit Notification 2022-03-01 09:53:59 UTC
Ouyang Leyan committed a patch related to this issue.
It has been pushed to "libreoffice-7-2":

https://git.libreoffice.org/core/commit/3b7c754dd83a8c9e887b7092aa10b0ff7041462d

tdf#146463 Apply data series filter to the chart legend

It will be available in 7.2.7.

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 13 Xisco Faulí 2022-03-01 13:00:21 UTC
I guess we can close this issue now.
@Leyan, thanks for fixing this issue
Comment 14 Leo Moons 2022-03-03 22:20:58 UTC
Hi developpers,

Thank you very much for solving this issue. I tested it in version 7.2.7 (windows) and it works flawless.