QT += core gui charts
#include <QtCharts/QChartView>
#include <QtCharts/QBarSeries>
#include <QtCharts/QBarSet>
#include <QtCharts/QBarCategoryAxis>
#include <QtCharts/QValueAxis>
#include <QDateTime>
#include <QTimer>
#include <QtCharts>
// 创建一个柱状图系列
QBarSeries *series = new QBarSeries();
// 创建一个柱状图集,用于存储数据
QBarSet *set = new QBarSet("数据");
set->append(400);
series->append(set);
// 创建一个类别轴,用于显示时间
QBarCategoryAxis *axisX = new QBarCategoryAxis();
axisX->setTitleText("时间");
QString currentTime = QDateTime::currentDateTime().toString("hh:mm:ss");
axisX->append(currentTime);
// 创建一个值轴,用于显示数值
QVa