2024-12-25 08:34:51 +08:00
|
|
|
|
#ifndef DPLINECHART_H
|
|
|
|
|
|
#define DPLINECHART_H
|
|
|
|
|
|
|
|
|
|
|
|
/*******************************************************************************
|
|
|
|
|
|
** DataPanel-LineChart
|
|
|
|
|
|
** author dsc
|
|
|
|
|
|
**
|
|
|
|
|
|
** 折线图展示面板,用来展示带有时序数据,可以和TimeLine等组件进行时间属性的交互
|
|
|
|
|
|
** 采用QCustomPlot实现
|
|
|
|
|
|
**
|
|
|
|
|
|
******************************************************************************/
|
|
|
|
|
|
|
2025-07-09 14:29:29 +08:00
|
|
|
|
#include "dpBaseChart.h"
|
2024-12-25 08:34:51 +08:00
|
|
|
|
|
|
|
|
|
|
class QCustomPlot;
|
2025-01-04 18:18:19 +08:00
|
|
|
|
class QCPRange;
|
2024-12-25 08:34:51 +08:00
|
|
|
|
|
2025-07-09 14:29:29 +08:00
|
|
|
|
class dpLineChart : public dpBaseChart
|
2024-12-25 08:34:51 +08:00
|
|
|
|
{
|
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
dpLineChart(QWidget *parent = nullptr);
|
|
|
|
|
|
~dpLineChart();
|
|
|
|
|
|
|
2025-07-09 14:29:29 +08:00
|
|
|
|
void setTimeRange(TimeUnit) override;
|
|
|
|
|
|
void setDateTime(const QDateTime&) override;
|
|
|
|
|
|
void viewHistoricalData(const QDateTime&) override;
|
2025-01-04 18:18:19 +08:00
|
|
|
|
|
2025-07-14 15:02:29 +08:00
|
|
|
|
void synchronizeConfigData(const configurationResults&) override;
|
|
|
|
|
|
|
2025-01-04 18:18:19 +08:00
|
|
|
|
public slots:
|
|
|
|
|
|
void onSignal_rangeChanged_xAxis(const QCPRange&);
|
2024-12-25 08:34:51 +08:00
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
void initQCP();
|
|
|
|
|
|
|
|
|
|
|
|
QCustomPlot* m_pCustomPlot;
|
2025-07-09 10:58:52 +08:00
|
|
|
|
ChartStyle m_chartStyle;
|
2025-01-04 18:18:19 +08:00
|
|
|
|
qint64 m_timeRange;
|
|
|
|
|
|
QDateTime m_curDateTime;
|
2025-07-14 15:02:29 +08:00
|
|
|
|
QVector<Axis> m_axes;
|
2024-12-25 08:34:51 +08:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|