This service will be undergoing maintenance at 00:00 UTC, 2017-10-23 It is expected to last about 30 minutes
Bug 1359961 - pmchart plots disappear when legend is turned off and back on again
pmchart plots disappear when legend is turned off and back on again
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: pcp (Show other bugs)
24
Unspecified Unspecified
unspecified Severity medium
: ---
: ---
Assigned To: Dave Brolley
Fedora Extras Quality Assurance
: Reopened
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2016-07-25 21:12 EDT by Mark Goodwin
Modified: 2017-06-09 15:02 EDT (History)
7 users (show)

See Also:
Fixed In Version: pcp-3.11.9-1.fc24 pcp-3.11.10-1.fc26
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2017-06-09 15:02:31 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Mark Goodwin 2016-07-25 21:12:28 EDT
Description of problem: pmchart plots disappear when legend is turned off and back on again using the Edit/chart dialog

Version-Release number of selected component (if applicable): pcp-3.11.3-1 / F24

How reproducible: easily

Steps to Reproduce:
1. pmchart -c Loadavg
2. Edit/Chart
3. Disable legend, Apply, Enable legend, Apply

Actual results: all plots disappear for the current chart

Expected results: legend re-enabled without loss of any plots!
Comment 1 Dave Brolley 2017-03-27 15:57:27 EDT
Here is a patch which fixes this problem. Reversed boolean logic was making the plots disappear when they were still visible. Seems like an obvious fix.

However, I'm wondering why this loop and replot are necessary at all. There is no similar check and replot when the legend is turned off. Removing this entire loop and the call to replot() also fixes this problem.

----------------------------------------------------------

diff --git a/src/pmchart/chart.cpp b/src/pmchart/chart.cpp
index f6b92a4..6a1f974 100644
--- a/src/pmchart/chart.cpp
+++ b/src/pmchart/chart.cpp
@@ -890,7 +890,7 @@ Chart::setLegendVisible(bool on)
            // force each Legend item to "checked" state matching
            // the initial plotting state
            for (int i = 0; i < my.items.size(); i++)
-               my.items[i]->item()->setVisible(my.items[i]->removed());
+               my.items[i]->item()->setVisible(!my.items[i]->removed());
            replot();
        }
     }
Comment 2 Dave Brolley 2017-03-27 16:51:08 EDT
Here's a possible reason for this check when restoring the legend.

If you click on a metric in the legend, you can toggle the plotting of that metric on and off. If you remove the legend while a metric is "off", it remains "off" if you later restore the legend. However the new legend is literally newly created and thinks that the metric is "on".

Including this loop and replot restores all active metrics to the "on" state in the plot.
Comment 3 Dave Brolley 2017-03-27 16:58:43 EDT
The original patch is now available as
 commit 7b23667da3449cf7adbbfcc83bff678f914054cc at
 git://git.pcp.io/brolley/pcp.git rhbz1359961
Comment 4 Fedora Update System 2017-04-02 01:13:10 EDT
pcp-3.11.9-1.fc26 has been submitted as an update to Fedora 26. https://bodhi.fedoraproject.org/updates/FEDORA-2017-aca0a468b4
Comment 5 Fedora Update System 2017-04-02 01:14:56 EDT
pcp-3.11.9-1.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2017-def05eeac1
Comment 6 Fedora Update System 2017-04-02 01:15:34 EDT
pcp-3.11.9-1.fc24 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2017-c6c3616693
Comment 7 Fedora Update System 2017-04-02 22:21:36 EDT
pcp-3.11.9-1.fc24 has been pushed to the Fedora 24 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-c6c3616693
Comment 8 Fedora Update System 2017-04-02 22:22:02 EDT
pcp-3.11.9-1.fc25 has been pushed to the Fedora 25 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-def05eeac1
Comment 9 Fedora Update System 2017-04-02 23:53:15 EDT
pcp-3.11.9-1.fc26 has been pushed to the Fedora 26 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-aca0a468b4
Comment 10 Fedora Update System 2017-04-10 17:20:38 EDT
pcp-3.11.9-1.fc25 has been pushed to the Fedora 25 stable repository. If problems still persist, please make note of it in this bug report.
Comment 11 Fedora Update System 2017-04-11 00:51:10 EDT
pcp-3.11.9-1.fc24 has been pushed to the Fedora 24 stable repository. If problems still persist, please make note of it in this bug report.
Comment 12 Fedora Update System 2017-05-18 12:31:00 EDT
pcp-3.11.10-1.fc26 has been submitted as an update to Fedora 26. https://bodhi.fedoraproject.org/updates/FEDORA-2017-c0a1605df5
Comment 13 Fedora Update System 2017-05-19 17:10:10 EDT
pcp-3.11.10-1.fc26 has been pushed to the Fedora 26 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-c0a1605df5
Comment 14 Fedora Update System 2017-06-09 15:02:31 EDT
pcp-3.11.10-1.fc26 has been pushed to the Fedora 26 stable repository. If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.