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!
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.