      updateSeries(sig);
    }
  }
  
  void ChartView::signalRemoved(const Signal *sig) {
    for (auto it = sigs.begin(); it != sigs.end(); /**/) {
      it = (it->sig == sig) ? removeItem(it) : ++it;
    }
  }
  
  void ChartView::msgUpdated(uint32_t address) {
    if (std::any_of(sigs.begin(), sigs.end(), [=](auto &s) { return s.address == address; }))
      updateTitle();
  }
  
 
</s> remove   return ret;
 </s> add  </s> remove     updateTitle();
}

void ChartView::manageSeries() {
  SeriesSelector dlg(tr("Mange Chart"), this);
  for (auto &s : sigs) {
 </s> add  </s> remove     removeIf([&](auto &s) {
      return std::none_of(items.cbegin(), items.cend(), [&](auto &it) { return s.msg_id == it->msg_id && s.sig == it->sig; });
    });
  }
}

void ChartView::resizeEvent(QResizeEvent *event) {
  updatePlotArea(align_to);
  int top_margin = style()->pixelMetric(QStyle::PM_LayoutTopMargin);
  int spacing = style()->pixelMetric(QStyle::PM_LayoutHorizontalSpacing);
  int x = event->size().width() - close_btn_proxy->size().width() - style()->pixelMetric(QStyle::PM_LayoutRightMargin);
  close_btn_proxy->setPos(x, top_margin);
 </s> add     for (auto s : items) {
      addSeries(s->msg_id, s->sig);
      updateSeries(sig);
    }
  }
  






  void ChartView::msgUpdated(uint32_t address) {
    if (std::any_of(sigs.begin(), sigs.end(), [=](auto &s) { return s.address == address; }))
      updateTitle();
  }
  
keep keep keep keep replace replace replace replace replace replace keep keep keep keep keep
 cabana: cleanup code for charts (#27350) 
tools/cabana/chartswidget.cc