DAWorkbench 0.0.1
DAWorkbench API
载入中...
搜索中...
未找到
DAChartStyleInterface.h
1#ifndef DACHARTSTYLEINTERFACE_H
2#define DACHARTSTYLEINTERFACE_H
3#include "DAFigureAPI.h"
4#include <QColor>
5#include <QBrush>
6#include <QFont>
7#include <QString>
8
9class QwtPlotGrid;
10class QwtPlotLegendItem;
11
12namespace DA
13{
14
18class DAFIGURE_API DAChartStyleInterface
19{
20public:
21 virtual ~DAChartStyleInterface() = default;
22
23 // ==================== 图表整体样式 ====================
24 virtual void setChartTitle(const QString& title) = 0;
25 virtual QString getChartTitle() const = 0;
26
27 virtual void setBackgroundBrush(const QBrush& brush) = 0;
28 virtual QBrush getBackgroundBrush() const = 0;
29
30 virtual void setBorderColor(const QColor& color) = 0;
31 virtual QColor getBorderColor() const = 0;
32
33 // ==================== 坐标轴样式 ====================
34 virtual void setAxisLabel(int axisId, const QString& label) = 0;
35 virtual QString getAxisLabel(int axisId) const = 0;
36
37 virtual void setAxisColor(int axisId, const QColor& color) = 0;
38 virtual QColor getAxisColor(int axisId) const = 0;
39
40 // ==================== 网格样式 ====================
41 virtual void enableGrid(bool enable = true) = 0;
42 virtual bool isGridEnabled() const = 0;
43 virtual void setGridStyle(const QColor& color, qreal width = 1.0, Qt::PenStyle style = Qt::DotLine, bool isMajor = true) = 0;
44 virtual void setGridMajorStyle(const QColor& color, qreal width = 1.0, Qt::PenStyle style = Qt::DotLine) = 0;
45 virtual void setGridMinorStyle(const QColor& color, qreal width = 0.5, Qt::PenStyle style = Qt::DotLine) = 0;
46
47 // ==================== 图例样式 ====================
48 virtual void enableLegend(bool enable = true) = 0;
49 virtual bool isLegendEnabled() const = 0;
50
51 virtual void setLegendPosition(Qt::Alignment alignment) = 0;
52 virtual Qt::Alignment getLegendPosition() const = 0;
53
54 virtual void setLegendBackground(const QBrush& brush) = 0;
55 virtual QBrush getLegendBackground() const = 0;
56
57 virtual void setLegendTextColor(const QColor& color) = 0;
58 virtual QColor getLegendTextColor() const = 0;
59
60 // ==================== 时间坐标轴 ====================
61 virtual void setupDateTimeAxis(int axisId, const QString& format = "yyyy-MM-dd hh:mm:ss") = 0;
62 virtual bool isDateTimeAxis(int axisId) const = 0;
63};
64
65} // namespace DA
66#endif // DACHARTSTYLEINTERFACE_H
图表样式设置接口 - 负责颜色、字体、背景、显示元素等样式设置
Definition DAChartStyleInterface.h:19
序列化类都是带异常的,使用中需要处理异常
Definition AppMainWindow.cpp:44