diff --git a/src/barplot.cpp b/src/barplot.cpp --- a/src/barplot.cpp +++ b/src/barplot.cpp @@ -25,9 +25,12 @@ BarPlot::BarPlot(ChannelManager* channel _channelMan = channelMan; barChart.attach(this); - connect(_channelMan, &ChannelManager::dataAdded, [this]() - { - barChart.resample(); - replot(); - }); + connect(_channelMan, &ChannelManager::dataAdded, this, &BarPlot::update); + connect(_channelMan, &ChannelManager::numOfChannelsChanged, this, &BarPlot::update); } + +void BarPlot::update() +{ + barChart.resample(); + replot(); +}