50 ChartTitleChanged = 0x1,
51 BackgroundChanged = 0x2,
52 BorderColorChanged = 0x4,
54 AxisLabelChanged = 0x10,
55 AxisColorChanged = 0x20,
56 AxisScaleChanged = 0x40,
58 GridEnabledChanged = 0x100,
63 LegendEnabledChanged = 0x400,
64 LegendPositionChanged = 0x800,
65 LegendBackgroundChanged = 0x1000,
66 LegendTextColorChanged = 0x2000,
67 LegendPanelEnabledChanged = 0x8000,
69 DateTimeScaleSetup = 0x10000,
71 ZoomStateChanged = 0x100000,
72 PanStateChanged = 0x200000,
73 CrosshairStateChanged = 0x400000,
74 DataPickingStateChanged =
76 MouseWheelZoomStateChanged = 0x1000000,
78 Q_ENUM(ChartPropertyChangeFlag)
79 Q_DECLARE_FLAGS(ChartPropertyChangeFlags, ChartPropertyChangeFlag)
86 virtual QList< int > dataRttis()
const override;
88 QwtPlotCurve* addCurve(
const QVector< double >& xData,
const QVector< double >& yData,
const QString& title = QString())
override;
89 QwtPlotCurve* addCurve(
const QVector< QPointF >& points,
const QString& title = QString())
override;
90 QList< QwtPlotCurve* > getCurves()
const override;
91 void removeCurve(QwtPlotCurve* curve)
override;
94 QwtPlotCurve* addScatter(
const QVector< QPointF >& points,
const QString& title = QString())
override;
97 QwtPlotBarChart* addBarChart(
const QVector< double >& values,
const QString& title = QString())
override;
98 QwtPlotBarChart* addBarChart(
const QVector< QPointF >& points,
const QString& title = QString())
override;
101 QwtPlotIntervalCurve* addIntervalCurve(
102 const QVector< double >& values,
103 const QVector< double >& mins,
104 const QVector< double >& maxs,
105 const QString& title = QString()
109 QwtPlotMarker* addVerticalLine(
double x,
const QString& title = QString())
override;
110 QwtPlotMarker* addHorizontalLine(
double y,
const QString& title = QString())
override;
111 QwtPlotMarker* addCrossLine(
double x,
double y,
const QString& title = QString())
override;
114 QwtPlotSpectrogram* addSpectrogram(QwtGridRasterData* gridData,
const QString& title = QString())
override;
117 void removePlotItem(QwtPlotItem* item)
override;
119 void clearAllData()
override;
122 QRectF getDataBounds()
const override;
123 bool hasData()
const override;
127 void setChartTitle(
const QString& title)
override;
128 QString getChartTitle()
const override;
130 void setBackgroundBrush(
const QBrush& brush)
override;
131 QBrush getBackgroundBrush()
const override;
133 void setBorderColor(
const QColor& color)
override;
134 QColor getBorderColor()
const override;
137 void setAxisLabel(
int axisId,
const QString& label)
override;
138 QString getAxisLabel(
int axisId)
const override;
140 void setAxisColor(
int axisId,
const QColor& color)
override;
141 QColor getAxisColor(
int axisId)
const override;
144 void enableGrid(
bool enable =
true)
override;
145 void enableGridX(
bool enable =
true);
146 void enableGridY(
bool enable =
true);
147 void enableGridXMin(
bool enable =
true);
148 void enableGridYMin(
bool enable =
true);
149 bool isGridEnabled()
const override;
150 bool isGridXEnabled()
const;
151 bool isGridYEnabled()
const;
152 bool isGridXMinEnabled()
const;
153 bool isGridYMinEnabled()
const;
155 void setGridStyle(
const QColor& color, qreal width = 1.0, Qt::PenStyle style = Qt::DotLine,
bool isMajor =
true)
override;
157 void setGridMajorStyle(
const QColor& color, qreal width = 1.0, Qt::PenStyle style = Qt::DotLine)
override;
159 void setGridMinorStyle(
const QColor& color, qreal width = 0.5, Qt::PenStyle style = Qt::DotLine)
override;
162 void enableLegend(
bool enable =
true)
override;
163 bool isLegendEnabled()
const override;
165 void setLegendPosition(Qt::Alignment alignment)
override;
166 Qt::Alignment getLegendPosition()
const override;
168 void setLegendBackground(
const QBrush& brush)
override;
169 QBrush getLegendBackground()
const override;
171 void setLegendTextColor(
const QColor& color)
override;
172 QColor getLegendTextColor()
const override;
175 void setupDateTimeAxis(
int axisId,
const QString& format =
"yyyy-MM-dd hh:mm:ss")
override;
176 bool isDateTimeAxis(
int axisId)
const override;
180 void enableZoom(
bool enable =
true)
override;
181 bool isZoomEnabled()
const override;
183 void zoomToOriginal()
override;
184 void zoomIn()
override;
185 void zoomOut()
override;
188 QwtPlotCanvasZoomer* getZoomer()
const override;
191 void enablePan(
bool enable =
true)
override;
192 bool isPanEnabled()
const override;
194 QwtPlotPanner* getPanner()
const override;
197 void enableCrosshair(
bool enable =
true)
override;
198 bool isCrosshairEnabled()
const override;
200 QwtPlotPicker* getCrosshair()
const override;
203 bool isDataPickingEnabled()
const;
205 void enableYValuePicking(
bool enable =
true)
override;
206 bool isYValuePickingEnabled()
const override;
208 void enableXYValuePicking(
bool enable =
true)
override;
209 bool isXYValuePickingEnabled()
const override;
211 QwtPlotSeriesDataPicker* getDataPicker()
const override;
214 void enableMouseWheelZoom(
bool enable =
true)
override;
215 bool isMouseWheelZoomEnabled()
const override;
217 QwtPlotMagnifier* getMagnifier()
const override;
220 void enableLegendPanel(
bool enable =
true)
override;
221 bool isLegendPanelEnabled()
const override;
223 QwtLegend* getLegendPanel()
const override;
227 void registerPannerFactory(
const PannerFactory& factory)
override;
228 void registerPickerFactory(
const PickerFactory& factory)
override;
229 void registerDataPickerFactory(
const DataPickerFactory& factory)
override;
234 void notifyPropertiesChanged(ChartPropertyChangeFlags flag);
237 void onLegendItemToggled(
const QVariant& itemInfo,
bool checked);
241 void chartPropertiesChanged(
DA::DAChartWidget* chart, DA::DAChartWidget::ChartPropertyChangeFlags flag);
244 void paintEvent(QPaintEvent* event)
override;
248 void initializeChart();
250 void initializeInteractions();
255 void setupMagnifier();
256 void setupCrosshair();
257 void setupDataPicker();
258 void setupLegendPanel();
261 QwtPlotGrid* getOrCreateGrid();
262 QwtPlotLegendItem* getOrCreateLegend();