QCustomPlot 切换曲线数据,改变图例名称

改变成新的数据后,执行 replot()函数,重新绘制

connect(ui->Bt,&QPushButton::clicked,this,[&]()
{
//设置新的数据
...
//设置新的名称
         m_customPlot->graph(0)->setName("新的图例名称");
        // 重画图像
         m_customPlot->replot();
});
posted @ 2023-03-15 17:08  雾枫  阅读(256)  评论(0编辑  收藏  举报