1 前提 Qt 2 具体操作 2.1 QChart #include "mainwindow.h" #include "ui_mainwindow.h" MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) , ui(new Ui::MainWindow) { ui->setupUi(this); //定义图表对象 QChart *chart =new QChart