59 lines
1.2 KiB
C++
59 lines
1.2 KiB
C++
#ifndef COALSTATISTICSCHARTWIDGET_H
|
|
#define COALSTATISTICSCHARTWIDGET_H
|
|
|
|
#include <QWidget>
|
|
#include <QtCharts>
|
|
|
|
QT_CHARTS_USE_NAMESPACE
|
|
namespace Ui {
|
|
class CoalStatisticsChartWidget;
|
|
}
|
|
|
|
enum TimeUnit {
|
|
Hour = 0, // 时
|
|
Day = 1, // 天
|
|
Month = 2, // 月
|
|
Year = 3 // 年
|
|
};
|
|
|
|
class CoalStatisticsChartWidget : public QWidget {
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit CoalStatisticsChartWidget(QWidget* parent = nullptr);
|
|
~CoalStatisticsChartWidget();
|
|
|
|
private slots:
|
|
|
|
/**
|
|
* @brief on_pushButton_coalStatisOk_clicked 点击确定按钮
|
|
*/
|
|
void on_pushButton_coalStatisOk_clicked();
|
|
|
|
private:
|
|
/**
|
|
* @brief initCoalStatisticsBarChart 初始化煤量统计柱状图
|
|
*/
|
|
void initCoalStatisticsBarChart();
|
|
|
|
/**
|
|
* @brief getCoalStatisInfoByHttpRequest通过Http请求获取煤量统计信息
|
|
*/
|
|
void getCoalStatisInfoByHttpRequest(const QString& startTime, const QString& endTime);
|
|
|
|
private:
|
|
Ui::CoalStatisticsChartWidget* ui;
|
|
|
|
QChart* m_chart;
|
|
QChartView* m_chartView;
|
|
QBarSeries* m_series;
|
|
QDateTimeAxis* m_axisX;
|
|
QValueAxis* m_axisY;
|
|
|
|
QTimer* m_timer;
|
|
|
|
QSettings* m_systemSetting;
|
|
};
|
|
|
|
#endif // COALSTATISTICSCHARTWIDGET_H
|