Changeset - 03e0fc31c78a
[Not reviewed]
Hasan Yavuz Ă–ZDERYA - 9 years ago 2017-01-03 04:29:40
hy@ozderya.net
show/hide legend items along with curves
1 file changed with 3 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/plotmanager.cpp
Show inline comments
 
@@ -136,11 +136,13 @@ void PlotManager::onChannelInfoChanged(c
 
        curves[ci]->setTitle(name);
 
        curves[ci]->setPen(color);
 
        curves[ci]->setVisible(visible);
 
        curves[ci]->setItemAttribute(QwtPlotItem::Legend, visible);
 

	
 
        // replot only updated widgets
 
        if (isMulti)
 
        {
 
            plotWidgets[ci]->updateSymbols(); // required for color change
 
            plotWidgets[ci]->updateLegend(curves[ci]);
 
            plotWidgets[ci]->replot();
 
        }
 
    }
 
@@ -149,6 +151,7 @@ void PlotManager::onChannelInfoChanged(c
 
    if (!isMulti)
 
    {
 
        plotWidgets[0]->updateSymbols();
 
        plotWidgets[0]->updateLegend();
 
        replot();
 
    }
 
}
0 comments (0 inline, 0 general)