Bug 1359961
Summary: | pmchart plots disappear when legend is turned off and back on again | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Mark Goodwin <mgoodwin> |
Component: | pcp | Assignee: | Dave Brolley <brolley> |
Status: | CLOSED ERRATA | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | medium | Docs Contact: | |
Priority: | unspecified | ||
Version: | 24 | CC: | brolley, fche, lberk, mgoodwin, nathans, pcp, scox |
Target Milestone: | --- | Keywords: | Reopened |
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
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 19:02:31 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Mark Goodwin
2016-07-26 01:12:28 UTC
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(); } } 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. The original patch is now available as commit 7b23667da3449cf7adbbfcc83bff678f914054cc at git://git.pcp.io/brolley/pcp.git rhbz1359961 pcp-3.11.9-1.fc26 has been submitted as an update to Fedora 26. https://bodhi.fedoraproject.org/updates/FEDORA-2017-aca0a468b4 pcp-3.11.9-1.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2017-def05eeac1 pcp-3.11.9-1.fc24 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2017-c6c3616693 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 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 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 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. 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. pcp-3.11.10-1.fc26 has been submitted as an update to Fedora 26. https://bodhi.fedoraproject.org/updates/FEDORA-2017-c0a1605df5 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 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. |