准备工作 下载qcustomplot.c、qcustomplot.h文件 分别添加到自己的工程中,并在.pro文件中,添加QT += printsupport greaterThan(QT_MAJOR_VERSION, 4): QT += widgets printsupport 基础函数 准备工作做完以后,最好qmake和构建一下。 在ui文件中拉一个widget窗口,然后右击提升 3. 基础函数说明 准备数据 //建立 x,y数组,举例为二次曲线 QVector <double> x(20),y