46 lines
1.0 KiB
C++
46 lines
1.0 KiB
C++
#ifndef DPLINECHART_H
|
||
#define DPLINECHART_H
|
||
|
||
/*******************************************************************************
|
||
** DataPanel-LineChart
|
||
** author dsc
|
||
**
|
||
** 折线图展示面板,用来展示带有时序数据,可以和TimeLine等组件进行时间属性的交互
|
||
** 采用QCustomPlot实现
|
||
**
|
||
******************************************************************************/
|
||
|
||
#include "dpBaseChart.h"
|
||
|
||
class QCustomPlot;
|
||
class QCPRange;
|
||
|
||
class dpLineChart : public dpBaseChart
|
||
{
|
||
Q_OBJECT
|
||
|
||
public:
|
||
dpLineChart(QWidget *parent = nullptr);
|
||
~dpLineChart();
|
||
|
||
void setTimeRange(TimeUnit) override;
|
||
void setDateTime(const QDateTime&) override;
|
||
void viewHistoricalData(const QDateTime&) override;
|
||
|
||
void synchronizeConfigData(const configurationResults&) override;
|
||
|
||
public slots:
|
||
void onSignal_rangeChanged_xAxis(const QCPRange&);
|
||
|
||
private:
|
||
void initQCP();
|
||
|
||
QCustomPlot* m_pCustomPlot;
|
||
ChartStyle m_chartStyle;
|
||
qint64 m_timeRange;
|
||
QDateTime m_curDateTime;
|
||
QVector<Axis> m_axes;
|
||
};
|
||
|
||
#endif
|