QCustomPlot 切换曲线数据,改变图例名称
改变成新的数据后,执行 replot()函数,重新绘制
connect(ui->Bt,&QPushButton::clicked,this,[&]()
{
//设置新的数据
...
//设置新的名称
m_customPlot->graph(0)->setName("新的图例名称");
// 重画图像
m_customPlot->replot();
});
改变成新的数据后,执行 replot()函数,重新绘制
connect(ui->Bt,&QPushButton::clicked,this,[&]()
{
//设置新的数据
...
//设置新的名称
m_customPlot->graph(0)->setName("新的图例名称");
// 重画图像
m_customPlot->replot();
});