@@ -1,6 +1,6 | |||||
1 | include(compat.qdocconf) |
|
1 | include(compat.qdocconf) | |
2 | include(macros.qdocconf) |
|
2 | include(macros.qdocconf) | |
3 |
include(qt-html-template |
|
3 | include(qchart-html-template.qdocconf) | |
4 |
|
4 | |||
5 | project = QtCommercialCharts |
|
5 | project = QtCommercialCharts | |
6 | description = Library for creating charts |
|
6 | description = Library for creating charts | |
@@ -10,13 +10,11 sourcedirs = ../src \ | |||||
10 | ./src |
|
10 | ./src | |
11 | headerdirs = ../src \ |
|
11 | headerdirs = ../src \ | |
12 | ../example |
|
12 | ../example | |
13 |
exampledirs = ../ |
|
13 | exampledirs = ../ \ | |
|
14 | ../src \ | |||
14 | ../example |
|
15 | ../example | |
15 |
|
16 | |||
16 | HTML.templatedir = . |
|
17 | excludefiles += ../example/linechart/linechart.pro | |
17 | HTML.stylesheets = style/offline.css |
|
|||
18 | HTML.headerstyles= "<link rel=\"stylesheet\" type=\"text/css\" href=\"style/offline.css\" />\n" |
|
|||
19 | HTML.nobreadcrumbs = true |
|
|||
20 |
|
18 | |||
21 | sources.fileextensions = *.cpp *.qdoc *.mm *.qml |
|
19 | sources.fileextensions = *.cpp *.qdoc *.mm *.qml | |
22 | headers.fileextensions = *.h *.ch *.h++ *.hh *.hpp *.hxx |
|
20 | headers.fileextensions = *.h *.ch *.h++ *.hh *.hpp *.hxx |
@@ -1,51 +1,12 | |||||
1 | /*! |
|
1 | /*! | |
2 | \page index.html |
|
2 | \page index.html | |
3 |
\title |
|
3 | \title About QCharts | |
4 |
\keyword A |
|
4 | \keyword About | |
5 |
|
||||
6 | TODO: restructure the document |
|
|||
7 |
|
||||
8 | QtCommercial Charts introduction... |
|
|||
9 | For example, to create a chart with line series using a widget based application: |
|
|||
10 | \snippet ../example/chartview/main.cpp 1 |
|
|||
11 | \image chartview_example.jpg |
|
|||
12 |
|
||||
13 | Showing a few more series: |
|
|||
14 | \snippet ../example/chartview/main.cpp 3 |
|
|||
15 | \image chartview_example_pie.jpg |
|
|||
16 | \snippet ../example/chartview/main.cpp 4 |
|
|||
17 | \image chartview_example_scatter.jpg |
|
|||
18 | \snippet ../example/chartview/main.cpp 5 |
|
|||
19 | \image chartview_example_bar.jpg |
|
|||
20 |
|
||||
21 | If you need to give a more professional touch to your chart you can switch to one of the |
|
|||
22 | pre-defined themes: |
|
|||
23 | \snippet ../example/chartview/main.cpp 2 |
|
|||
24 | \image chartview_example_theme.jpg |
|
|||
25 |
|
5 | |||
26 |
|
|
6 | \raw HTML | |
27 | <table cellpadding="2" cellspacing="1" border="0" width="100%" class="indextable"> |
|
7 | <div class="qchart"> | |
28 | <tr> |
|
8 | <img src="images/qt_commercial_logo.png" alt="qtcommercial"/> | |
29 | <th class="titleheader" width="33%"> |
|
9 | <p>QCharts is a part of Qt Commercial addons package.</p> | |
30 | List of classes |
|
10 | </div> | |
31 | </th> |
|
|||
32 | </tr> |
|
|||
33 | <tr> |
|
|||
34 | <td valign="top"> |
|
|||
35 | <ul> |
|
|||
36 | <li><a href="qchart.html">QChart</a></li> |
|
|||
37 | <li><a href="qchartview.html">QChartView</a></li> |
|
|||
38 | <li><a href="qchartseries.html">QChartSeries</a></li> |
|
|||
39 | <li><a href="qlinechartseries.html">QLineChartSeries</a></li> |
|
|||
40 | <li><a href="qpieseries.html">QPieSeries</a></li> |
|
|||
41 | <li><a href="qbarchartseries.html">QBarChartSeries</a></li> |
|
|||
42 | <li><a href="qstackedbarchartseries.html">QStackedBarChartSeries</a></li> |
|
|||
43 | <li><a href="qpercentbarchartseries.html">QPercentBarChartSeries</a></li> |
|
|||
44 | <li><a href="qscatterseries.html">QScatterSeries</a></li> |
|
|||
45 | </ul> |
|
|||
46 | </td> |
|
|||
47 | </tr> |
|
|||
48 | </table> |
|
|||
49 | \endraw |
|
11 | \endraw | |
50 |
|
||||
51 | */ |
|
12 | */ |
@@ -1,6 +1,11 | |||||
1 | @media screen |
|
1 | @media screen | |
2 | { |
|
2 | { | |
3 |
|
3 | |||
|
4 | .qchart img | |||
|
5 | { | |||
|
6 | float:left; | |||
|
7 | } | |||
|
8 | ||||
4 | /* basic elements */ |
|
9 | /* basic elements */ | |
5 | html |
|
10 | html | |
6 | { |
|
11 | { | |
@@ -232,12 +237,21 | |||||
232 | { |
|
237 | { | |
233 | color: #00732F; |
|
238 | color: #00732F; | |
234 | font-weight: bold; |
|
239 | font-weight: bold; | |
235 |
font-size: 1 |
|
240 | font-size: 100%; | |
|
241 | text-align: center; | |||
236 | } |
|
242 | } | |
237 |
|
243 | |||
238 | .header .content |
|
244 | .header .content | |
239 | { |
|
245 | { | |
240 | margin-bottom: 0.5em |
|
246 | /* margin-bottom: 0.5em*/ | |
|
247 | } | |||
|
248 | ||||
|
249 | .header .content img | |||
|
250 | { | |||
|
251 | display: block; | |||
|
252 | margin-left: auto; | |||
|
253 | margin-right: auto; | |||
|
254 | width: 100px; | |||
241 | } |
|
255 | } | |
242 |
|
256 | |||
243 | .naviNextPrevious |
|
257 | .naviNextPrevious | |
@@ -246,11 +260,13 | |||||
246 | } |
|
260 | } | |
247 | .header .breadcrumb |
|
261 | .header .breadcrumb | |
248 | { |
|
262 | { | |
249 |
font-size: |
|
263 | font-size: 100%; | |
250 | padding: 0.5em 0 0.5em 1em; |
|
264 | padding: 0.5em 0 0.5em 1em; | |
251 | margin: 0; |
|
265 | margin: 0; | |
252 |
background-color: # |
|
266 | /*background-color: #393735;*/ | |
253 | height: 1.35em; |
|
267 | font-weight: bold; | |
|
268 | background: #ffffff url(../images/bg.png) repeat-x; | |||
|
269 | height: 20px; | |||
254 | border-bottom: 1px solid #d1d1d1; |
|
270 | border-bottom: 1px solid #d1d1d1; | |
255 | } |
|
271 | } | |
256 |
|
272 | |||
@@ -268,7 +284,7 | |||||
268 | .header .breadcrumb ul li |
|
284 | .header .breadcrumb ul li | |
269 | { |
|
285 | { | |
270 | float: left; |
|
286 | float: left; | |
271 | background: url(../images/breadcrumb.png) no-repeat 0 3px; |
|
287 | /*background: url(../images/breadcrumb.png) no-repeat 0 3px;*/ | |
272 | padding-left: 1.5em; |
|
288 | padding-left: 1.5em; | |
273 | margin-left: 1.5em; |
|
289 | margin-left: 1.5em; | |
274 | } |
|
290 | } | |
@@ -280,7 +296,13 | |||||
280 |
|
296 | |||
281 | .header .breadcrumb ul li a |
|
297 | .header .breadcrumb ul li a | |
282 | { |
|
298 | { | |
|
299 | color: #ffffff; | |||
|
300 | } | |||
|
301 | ||||
|
302 | .header .breadcrumb ul li a:hover | |||
|
303 | { | |||
283 |
|
|
304 | color: #00732F; | |
|
305 | text-decoration: none; | |||
284 | } |
|
306 | } | |
285 |
|
307 | |||
286 | .header .breadcrumb ul li.first |
|
308 | .header .breadcrumb ul li.first | |
@@ -479,7 +501,7 | |||||
479 |
|
501 | |||
480 | .content .toc h3 { |
|
502 | .content .toc h3 { | |
481 | border-bottom: 0px; |
|
503 | border-bottom: 0px; | |
482 | margin-top: 0px; |
|
504 | margin-top: 10px; | |
483 | } |
|
505 | } | |
484 |
|
506 | |||
485 | .content .toc h3 a:hover { |
|
507 | .content .toc h3 a:hover { |
@@ -7,36 +7,46 | |||||
7 |
|
7 | |||
8 | QTCOMMERCIALCHART_USE_NAMESPACE |
|
8 | QTCOMMERCIALCHART_USE_NAMESPACE | |
9 |
|
9 | |||
10 | #define PI 3.14159265358979 |
|
|||
11 |
|
||||
12 | int main(int argc, char *argv[]) |
|
10 | int main(int argc, char *argv[]) | |
13 | { |
|
11 | { | |
14 | QApplication a(argc, argv); |
|
12 | QApplication a(argc, argv); | |
15 |
|
13 | |||
16 | QMainWindow window; |
|
14 | QMainWindow window; | |
17 |
|
15 | |||
|
16 | //![1] | |||
|
17 | ||||
18 | QLineChartSeries* series0 = new QLineChartSeries(); |
|
18 | QLineChartSeries* series0 = new QLineChartSeries(); | |
19 | QPen blue(Qt::blue); |
|
19 | QPen blue(Qt::blue); | |
20 | blue.setWidth(3); |
|
20 | blue.setWidth(3); | |
21 | series0->setPen(blue); |
|
21 | series0->setPen(blue); | |
|
22 | ||||
22 | QLineChartSeries* series1 = new QLineChartSeries(); |
|
23 | QLineChartSeries* series1 = new QLineChartSeries(); | |
23 | QPen red(Qt::red); |
|
24 | QPen red(Qt::red); | |
24 | red.setWidth(3); |
|
25 | red.setWidth(3); | |
25 | series1->setPen(red); |
|
26 | series1->setPen(red); | |
26 |
|
27 | //![1] | ||
27 | int numPoints = 100; |
|
28 | ||
28 |
|
29 | //![2] | ||
29 | for (int x = 0; x <= numPoints; ++x) { |
|
30 | series0->add(0, 6); | |
30 |
|
|
31 | series0->add(2, 4); | |
31 | series1->add(x, fabs(cos(PI/50*x)*100)); |
|
32 | series0->add(3, 8); | |
32 | } |
|
33 | series0->add(7, 4); | |
33 |
|
34 | series0->add(10,5); | ||
|
35 | ||||
|
36 | series1->add(1, 1); | |||
|
37 | series1->add(3, 3); | |||
|
38 | series1->add(7, 6); | |||
|
39 | series1->add(8, 3); | |||
|
40 | series1->add(10,2); | |||
|
41 | //![2] | |||
|
42 | //![3] | |||
34 | QChartView* chartView = new QChartView(&window); |
|
43 | QChartView* chartView = new QChartView(&window); | |
35 |
|
44 | |||
36 | chartView->setRenderHint(QPainter::Antialiasing); |
|
45 | chartView->setRenderHint(QPainter::Antialiasing); | |
37 | chartView->setChartTitle("Basic line chart example"); |
|
46 | chartView->setChartTitle("Basic line chart example"); | |
38 | chartView->addSeries(series0); |
|
47 | chartView->addSeries(series0); | |
39 | chartView->addSeries(series1); |
|
48 | chartView->addSeries(series1); | |
|
49 | //![3] | |||
40 |
|
50 | |||
41 | window.setCentralWidget(chartView); |
|
51 | window.setCentralWidget(chartView); | |
42 | window.resize(400, 300); |
|
52 | window.resize(400, 300); |
@@ -2,15 +2,75 | |||||
2 |
|
2 | |||
3 | QTCOMMERCIALCHART_BEGIN_NAMESPACE |
|
3 | QTCOMMERCIALCHART_BEGIN_NAMESPACE | |
4 |
|
4 | |||
|
5 | /*! | |||
|
6 | \class QLineChartSeries | |||
|
7 | \brief The QLineChartSeries class is used for making line charts. | |||
|
8 | ||||
|
9 | \mainclass | |||
|
10 | ||||
|
11 | A line chart is used to show information as a series of data points | |||
|
12 | connected by straight lines. | |||
|
13 | ||||
|
14 | \image linechart.png | |||
|
15 | ||||
|
16 | To create line charts, users need to first QLineChartSeries object. | |||
|
17 | ||||
|
18 | \snippet ../example/linechart/main.cpp 1 | |||
|
19 | ||||
|
20 | Populate with the data | |||
|
21 | ||||
|
22 | \snippet ../example/linechart/main.cpp 2 | |||
|
23 | ||||
|
24 | Add created series objects to QChartView or QChart instance. | |||
|
25 | ||||
|
26 | \snippet ../example/linechart/main.cpp 3 | |||
|
27 | ||||
|
28 | */ | |||
|
29 | ||||
|
30 | /*! | |||
|
31 | \fn virtual QChartSeriesType QLineChartSeries::type() const | |||
|
32 | \brief Returns type of series. | |||
|
33 | \sa QChartSeries, QChartSeriesType | |||
|
34 | */ | |||
|
35 | ||||
|
36 | /*! | |||
|
37 | \fn QPen QLineChartSeries::pen() const | |||
|
38 | \brief Returns the pen used to draw line for this series. | |||
|
39 | \sa setPen() | |||
|
40 | */ | |||
|
41 | ||||
|
42 | /*! | |||
|
43 | \fn bool isPointsVisible() const | |||
|
44 | \brief Returns if the points are drawn for this series. | |||
|
45 | \sa setPointsVisible() | |||
|
46 | */ | |||
|
47 | ||||
|
48 | ||||
|
49 | /*! | |||
|
50 | \fn void QLineChartSeries::changed(int index) | |||
|
51 | \brief \internal \a index | |||
|
52 | */ | |||
|
53 | ||||
|
54 | /*! | |||
|
55 | Constructs empty series object which is a child of \a parent. | |||
|
56 | When series object is added to QChartView or QChart instance ownerships is transfered. | |||
|
57 | */ | |||
5 | QLineChartSeries::QLineChartSeries(QObject* parent):QChartSeries(parent), |
|
58 | QLineChartSeries::QLineChartSeries(QObject* parent):QChartSeries(parent), | |
6 | m_pointsVisible(false) |
|
59 | m_pointsVisible(false) | |
7 | { |
|
60 | { | |
8 | } |
|
61 | } | |
9 |
|
62 | /*! | ||
|
63 | Destroys the object. Series added to QChartView or QChart instances are owned by those, | |||
|
64 | and are deleted when mentioned object are destroyed. | |||
|
65 | */ | |||
10 | QLineChartSeries::~QLineChartSeries() |
|
66 | QLineChartSeries::~QLineChartSeries() | |
11 | { |
|
67 | { | |
12 | } |
|
68 | } | |
13 |
|
69 | |||
|
70 | /*! | |||
|
71 | Adds data point \a x \a y to the series. Points are connected with lines on the chart. | |||
|
72 | Function returns index, which can be used to modify data. | |||
|
73 | */ | |||
14 | int QLineChartSeries::add(qreal x,qreal y) |
|
74 | int QLineChartSeries::add(qreal x,qreal y) | |
15 | { |
|
75 | { | |
16 | m_x<<x; |
|
76 | m_x<<x; | |
@@ -18,6 +78,21 int QLineChartSeries::add(qreal x,qreal y) | |||||
18 | return m_x.size()-1; |
|
78 | return m_x.size()-1; | |
19 | } |
|
79 | } | |
20 |
|
80 | |||
|
81 | /*! | |||
|
82 | This is an overloaded function. | |||
|
83 | Adds data \a point to the series. Points are connected with lines on the chart. | |||
|
84 | Function returns index, which can be used to modify data. | |||
|
85 | */ | |||
|
86 | int QLineChartSeries::add(const QPointF& point) | |||
|
87 | { | |||
|
88 | m_x<<point.x(); | |||
|
89 | m_y<<point.y(); | |||
|
90 | return m_x.size()-1; | |||
|
91 | } | |||
|
92 | ||||
|
93 | /*! | |||
|
94 | Modifies data within \a index, sets new \a x and \a y values. | |||
|
95 | */ | |||
21 | void QLineChartSeries::set(int index,qreal x,qreal y) |
|
96 | void QLineChartSeries::set(int index,qreal x,qreal y) | |
22 | { |
|
97 | { | |
23 | m_x[index]=x; |
|
98 | m_x[index]=x; | |
@@ -25,22 +100,46 void QLineChartSeries::set(int index,qreal x,qreal y) | |||||
25 | emit changed(index); |
|
100 | emit changed(index); | |
26 | } |
|
101 | } | |
27 |
|
102 | |||
|
103 | /*! | |||
|
104 | This is an overloaded function. | |||
|
105 | Modifies data within \a index, sets new \a point value. | |||
|
106 | */ | |||
|
107 | void QLineChartSeries::set(int index,const QPointF& point) | |||
|
108 | { | |||
|
109 | m_x[index]=point.x(); | |||
|
110 | m_y[index]=point.y(); | |||
|
111 | emit changed(index); | |||
|
112 | } | |||
|
113 | ||||
|
114 | ||||
|
115 | /*! | |||
|
116 | Clears all the data. | |||
|
117 | */ | |||
28 | void QLineChartSeries::clear() |
|
118 | void QLineChartSeries::clear() | |
29 | { |
|
119 | { | |
30 | m_x.clear(); |
|
120 | m_x.clear(); | |
31 | m_y.clear(); |
|
121 | m_y.clear(); | |
32 | } |
|
122 | } | |
33 |
|
123 | |||
|
124 | /*! | |||
|
125 | \internal \a pos | |||
|
126 | */ | |||
34 | qreal QLineChartSeries::x(int pos) const |
|
127 | qreal QLineChartSeries::x(int pos) const | |
35 | { |
|
128 | { | |
36 | return m_x.at(pos); |
|
129 | return m_x.at(pos); | |
37 | } |
|
130 | } | |
38 |
|
131 | |||
|
132 | /*! | |||
|
133 | \internal \a pos | |||
|
134 | */ | |||
39 | qreal QLineChartSeries::y(int pos) const |
|
135 | qreal QLineChartSeries::y(int pos) const | |
40 | { |
|
136 | { | |
41 | return m_y.at(pos); |
|
137 | return m_y.at(pos); | |
42 | } |
|
138 | } | |
43 |
|
139 | |||
|
140 | /*! | |||
|
141 | Returns number of data points within series. | |||
|
142 | */ | |||
44 | int QLineChartSeries::count() const |
|
143 | int QLineChartSeries::count() const | |
45 | { |
|
144 | { | |
46 | Q_ASSERT(m_x.size() == m_y.size()); |
|
145 | Q_ASSERT(m_x.size() == m_y.size()); | |
@@ -49,11 +148,22 int QLineChartSeries::count() const | |||||
49 |
|
148 | |||
50 | } |
|
149 | } | |
51 |
|
150 | |||
|
151 | /*! | |||
|
152 | Sets \a pen used for drawing given series.. | |||
|
153 | */ | |||
52 | void QLineChartSeries::setPen(const QPen& pen) |
|
154 | void QLineChartSeries::setPen(const QPen& pen) | |
53 | { |
|
155 | { | |
54 | m_pen=pen; |
|
156 | m_pen=pen; | |
55 | } |
|
157 | } | |
56 |
|
158 | |||
|
159 | /*! | |||
|
160 | Sets if data points are \a visible and should be drawn on line. | |||
|
161 | */ | |||
|
162 | void QLineChartSeries::setPointsVisible(bool visible) | |||
|
163 | { | |||
|
164 | m_pointsVisible=visible; | |||
|
165 | } | |||
|
166 | ||||
57 | QDebug operator<< (QDebug debug, const QLineChartSeries series) |
|
167 | QDebug operator<< (QDebug debug, const QLineChartSeries series) | |
58 | { |
|
168 | { | |
59 | Q_ASSERT(series.m_x.size() == series.m_y.size()); |
|
169 | Q_ASSERT(series.m_x.size() == series.m_y.size()); | |
@@ -66,10 +176,7 QDebug operator<< (QDebug debug, const QLineChartSeries series) | |||||
66 | return debug.space(); |
|
176 | return debug.space(); | |
67 | } |
|
177 | } | |
68 |
|
178 | |||
69 | void QLineChartSeries::setPointsVisible(bool visible) |
|
179 | ||
70 | { |
|
|||
71 | m_pointsVisible=visible; |
|
|||
72 | } |
|
|||
73 | #include "moc_qlinechartseries.cpp" |
|
180 | #include "moc_qlinechartseries.cpp" | |
74 |
|
181 | |||
75 | QTCOMMERCIALCHART_END_NAMESPACE |
|
182 | QTCOMMERCIALCHART_END_NAMESPACE |
@@ -19,11 +19,13 public: | |||||
19 | public: // from QChartSeries |
|
19 | public: // from QChartSeries | |
20 | virtual QChartSeriesType type() const { return QChartSeries::SeriesTypeLine;} |
|
20 | virtual QChartSeriesType type() const { return QChartSeries::SeriesTypeLine;} | |
21 | int add(qreal x, qreal y); |
|
21 | int add(qreal x, qreal y); | |
|
22 | int add(const QPointF& point); | |||
22 | void set(int index,qreal x,qreal y); |
|
23 | void set(int index,qreal x,qreal y); | |
|
24 | void set(int index,const QPointF& point); | |||
23 | void clear(); |
|
25 | void clear(); | |
24 |
|
26 | |||
25 | void setPen(const QPen& pen); |
|
27 | void setPen(const QPen& pen); | |
26 |
|
|
28 | QPen pen() const { return m_pen;} | |
27 |
|
29 | |||
28 | void setPointsVisible(bool visible); |
|
30 | void setPointsVisible(bool visible); | |
29 | bool isPointsVisible() const {return m_pointsVisible;} |
|
31 | bool isPointsVisible() const {return m_pointsVisible;} |
@@ -2,6 +2,81 | |||||
2 |
|
2 | |||
3 | QTCOMMERCIALCHART_BEGIN_NAMESPACE |
|
3 | QTCOMMERCIALCHART_BEGIN_NAMESPACE | |
4 |
|
4 | |||
|
5 | /*! | |||
|
6 | \class QChartAxis | |||
|
7 | \brief The QChartAxis class is used for manipulating chart's axis | |||
|
8 | and for adding optional axes to the chart. | |||
|
9 | \mainclass | |||
|
10 | ||||
|
11 | There is only one x Axis, however there can be multiple y axes. | |||
|
12 | Each chart series can be bound to exactly one Y axis and the share common X axis. | |||
|
13 | Axis can be setup to show axis line with ticks, gird lines and shades. | |||
|
14 | ||||
|
15 | */ | |||
|
16 | ||||
|
17 | /*! | |||
|
18 | \fn QPen QChartAxis::axisPen() const | |||
|
19 | \brief Returns pen used to draw axis and ticks. | |||
|
20 | \sa setAxisPen() | |||
|
21 | */ | |||
|
22 | ||||
|
23 | /*! | |||
|
24 | \fn QPen QChartAxis::gridPen() const | |||
|
25 | \brief Returns pen used to draw grid. | |||
|
26 | \sa setGridPen() | |||
|
27 | */ | |||
|
28 | ||||
|
29 | /*! | |||
|
30 | \fn QPen QChartAxis::labelsPen() const | |||
|
31 | \brief Returns the pen used to labels. | |||
|
32 | \sa setLabelsPen() | |||
|
33 | */ | |||
|
34 | ||||
|
35 | /*! | |||
|
36 | \fn QBrush QChartAxis::labelsBrush() const | |||
|
37 | \brief Returns brush used to draw labels. | |||
|
38 | \sa setLabelsBrush() | |||
|
39 | */ | |||
|
40 | ||||
|
41 | /*! | |||
|
42 | \fn QFont QChartAxis::labelsFont() const | |||
|
43 | \brief Returns font used to draw labels. | |||
|
44 | \sa setLabelsFont() | |||
|
45 | */ | |||
|
46 | ||||
|
47 | /*! | |||
|
48 | \fn QFont QChartAxis::labelsAngle() const | |||
|
49 | \brief Returns angle used to draw labels. | |||
|
50 | \sa setLabelsAngle() | |||
|
51 | */ | |||
|
52 | ||||
|
53 | /*! | |||
|
54 | \fn QPen QChartAxis::shadesPen() const | |||
|
55 | \brief Returns pen used to draw shades. | |||
|
56 | \sa setShadesPen() | |||
|
57 | */ | |||
|
58 | ||||
|
59 | /*! | |||
|
60 | \fn QBrush QChartAxis::shadesBrush() const | |||
|
61 | \brief Returns brush used to draw shades. | |||
|
62 | \sa setShadesBrush() | |||
|
63 | */ | |||
|
64 | ||||
|
65 | /*! | |||
|
66 | \fn void QChartAxis::update(QChartAxis*) | |||
|
67 | \brief \internal | |||
|
68 | */ | |||
|
69 | ||||
|
70 | /*! | |||
|
71 | \fn void QChartAxis::ticksChanged(QChartAxis*) | |||
|
72 | \brief \internal | |||
|
73 | */ | |||
|
74 | ||||
|
75 | /*! | |||
|
76 | Constructs new axis object which is a child of \a parent. Ownership is taken by | |||
|
77 | QChatView or QChart when axis added. | |||
|
78 | */ | |||
|
79 | ||||
5 | QChartAxis::QChartAxis(QObject* parent):QObject(parent), |
|
80 | QChartAxis::QChartAxis(QObject* parent):QObject(parent), | |
6 | m_axisVisible(true), |
|
81 | m_axisVisible(true), | |
7 | m_gridVisible(true), |
|
82 | m_gridVisible(true), | |
@@ -16,88 +91,134 m_ticksCount(5) | |||||
16 |
|
91 | |||
17 | } |
|
92 | } | |
18 |
|
93 | |||
|
94 | /*! | |||
|
95 | Destructor of the axis object. When axis is added to chart, chart object takes ownership. | |||
|
96 | */ | |||
|
97 | ||||
19 | QChartAxis::~QChartAxis() |
|
98 | QChartAxis::~QChartAxis() | |
20 | { |
|
99 | { | |
21 | } |
|
100 | } | |
22 |
|
101 | |||
|
102 | /*! | |||
|
103 | Sets \a pen used to draw axis line and ticks. | |||
|
104 | */ | |||
23 | void QChartAxis::setAxisPen(const QPen& pen) |
|
105 | void QChartAxis::setAxisPen(const QPen& pen) | |
24 | { |
|
106 | { | |
25 | m_axisPen=pen; |
|
107 | m_axisPen=pen; | |
26 | emit update(this); |
|
108 | emit update(this); | |
27 | } |
|
109 | } | |
28 |
|
110 | |||
|
111 | /*! | |||
|
112 | Sets if axis and ticks are \a visible. | |||
|
113 | */ | |||
29 | void QChartAxis::setAxisVisible(bool visible) |
|
114 | void QChartAxis::setAxisVisible(bool visible) | |
30 | { |
|
115 | { | |
31 | m_axisVisible=visible; |
|
116 | m_axisVisible=visible; | |
32 | emit update(this); |
|
117 | emit update(this); | |
33 | } |
|
118 | } | |
34 |
|
119 | |||
|
120 | /*! | |||
|
121 | Sets if grid is \a visible. | |||
|
122 | */ | |||
35 | void QChartAxis::setGridVisible(bool visible) |
|
123 | void QChartAxis::setGridVisible(bool visible) | |
36 | { |
|
124 | { | |
37 | m_gridVisible=visible; |
|
125 | m_gridVisible=visible; | |
38 | emit update(this); |
|
126 | emit update(this); | |
39 | } |
|
127 | } | |
40 |
|
128 | |||
|
129 | /*! | |||
|
130 | Sets \a pen used to draw grid. | |||
|
131 | */ | |||
41 | void QChartAxis::setGridPen(const QPen& pen) |
|
132 | void QChartAxis::setGridPen(const QPen& pen) | |
42 | { |
|
133 | { | |
43 | m_gridPen=pen; |
|
134 | m_gridPen=pen; | |
44 | emit update(this); |
|
135 | emit update(this); | |
45 | } |
|
136 | } | |
46 |
|
137 | |||
|
138 | /*! | |||
|
139 | Sets if axis' labels are \a visible. | |||
|
140 | */ | |||
47 | void QChartAxis::setLabelsVisible(bool visible) |
|
141 | void QChartAxis::setLabelsVisible(bool visible) | |
48 | { |
|
142 | { | |
49 | m_labelsVisible=visible; |
|
143 | m_labelsVisible=visible; | |
50 | emit update(this); |
|
144 | emit update(this); | |
51 | } |
|
145 | } | |
52 |
|
146 | |||
|
147 | /*! | |||
|
148 | Sets \a pen used to draw labels. | |||
|
149 | */ | |||
53 | void QChartAxis::setLabelsPen(const QPen& pen) |
|
150 | void QChartAxis::setLabelsPen(const QPen& pen) | |
54 | { |
|
151 | { | |
55 | m_labelsPen=pen; |
|
152 | m_labelsPen=pen; | |
56 | emit update(this); |
|
153 | emit update(this); | |
57 | } |
|
154 | } | |
58 |
|
155 | |||
|
156 | /*! | |||
|
157 | Sets \a brush used to draw labels. | |||
|
158 | */ | |||
59 | void QChartAxis::setLabelsBrush(const QBrush& brush) |
|
159 | void QChartAxis::setLabelsBrush(const QBrush& brush) | |
60 | { |
|
160 | { | |
61 | m_labelsBrush=brush; |
|
161 | m_labelsBrush=brush; | |
62 | emit update(this); |
|
162 | emit update(this); | |
63 | } |
|
163 | } | |
64 |
|
164 | |||
|
165 | /*! | |||
|
166 | Sets \a font used to draw labels. | |||
|
167 | */ | |||
65 | void QChartAxis::setLabelsFont(const QFont& font) |
|
168 | void QChartAxis::setLabelsFont(const QFont& font) | |
66 | { |
|
169 | { | |
67 | m_labelsFont=font; |
|
170 | m_labelsFont=font; | |
68 | emit update(this); |
|
171 | emit update(this); | |
69 | } |
|
172 | } | |
70 |
|
173 | |||
|
174 | /*! | |||
|
175 | Sets \a angle for all the labels on given axis. | |||
|
176 | */ | |||
71 | void QChartAxis::setLabelsAngle(int angle) |
|
177 | void QChartAxis::setLabelsAngle(int angle) | |
72 | { |
|
178 | { | |
73 | m_labelsAngle=angle; |
|
179 | m_labelsAngle=angle; | |
74 | emit update(this); |
|
180 | emit update(this); | |
75 | } |
|
181 | } | |
76 |
|
182 | |||
|
183 | /*! | |||
|
184 | Sets if shades are \a visible. | |||
|
185 | */ | |||
77 | void QChartAxis::setShadesVisible(bool visible) |
|
186 | void QChartAxis::setShadesVisible(bool visible) | |
78 | { |
|
187 | { | |
79 | m_shadesVisible=visible; |
|
188 | m_shadesVisible=visible; | |
80 | emit update(this); |
|
189 | emit update(this); | |
81 | } |
|
190 | } | |
82 |
|
191 | |||
|
192 | /*! | |||
|
193 | Sets \a pen used to draw shades. | |||
|
194 | */ | |||
83 | void QChartAxis::setShadesPen(const QPen& pen) |
|
195 | void QChartAxis::setShadesPen(const QPen& pen) | |
84 | { |
|
196 | { | |
85 | m_shadesPen=pen; |
|
197 | m_shadesPen=pen; | |
86 | emit update(this); |
|
198 | emit update(this); | |
87 | } |
|
199 | } | |
88 |
|
200 | |||
|
201 | /*! | |||
|
202 | Sets \a brush used to draw shades. | |||
|
203 | */ | |||
89 | void QChartAxis::setShadesBrush(const QBrush& brush) |
|
204 | void QChartAxis::setShadesBrush(const QBrush& brush) | |
90 | { |
|
205 | { | |
91 | m_shadesBrush=brush; |
|
206 | m_shadesBrush=brush; | |
92 | emit update(this); |
|
207 | emit update(this); | |
93 | } |
|
208 | } | |
94 |
|
209 | |||
|
210 | /*! | |||
|
211 | Sets \a opacity of the shades. | |||
|
212 | */ | |||
95 | void QChartAxis::setShadesOpacity(qreal opacity) |
|
213 | void QChartAxis::setShadesOpacity(qreal opacity) | |
96 | { |
|
214 | { | |
97 | m_shadesOpacity=opacity; |
|
215 | m_shadesOpacity=opacity; | |
98 | emit update(this); |
|
216 | emit update(this); | |
99 | } |
|
217 | } | |
100 |
|
218 | |||
|
219 | /*! | |||
|
220 | Sets \a min value on the axis. | |||
|
221 | */ | |||
101 | void QChartAxis::setMin(qreal min) |
|
222 | void QChartAxis::setMin(qreal min) | |
102 | { |
|
223 | { | |
103 | if(m_min!=min){ |
|
224 | if(m_min!=min){ | |
@@ -106,6 +227,9 void QChartAxis::setMin(qreal min) | |||||
106 | } |
|
227 | } | |
107 | } |
|
228 | } | |
108 |
|
229 | |||
|
230 | /*! | |||
|
231 | Sets \a max value on the axis. | |||
|
232 | */ | |||
109 | void QChartAxis::setMax(qreal max) |
|
233 | void QChartAxis::setMax(qreal max) | |
110 | { |
|
234 | { | |
111 | if(m_max!=max){ |
|
235 | if(m_max!=max){ | |
@@ -114,35 +238,53 void QChartAxis::setMax(qreal max) | |||||
114 | } |
|
238 | } | |
115 | } |
|
239 | } | |
116 |
|
240 | |||
|
241 | /*! | |||
|
242 | Sets range from \a min to \a max on the axis. | |||
|
243 | */ | |||
117 | void QChartAxis::setRange(qreal min, qreal max) |
|
244 | void QChartAxis::setRange(qreal min, qreal max) | |
118 | { |
|
245 | { | |
119 | setMin(min); |
|
246 | setMin(min); | |
120 | setMax(max); |
|
247 | setMax(max); | |
121 | } |
|
248 | } | |
122 |
|
249 | |||
|
250 | /*! | |||
|
251 | Sets \a count for ticks on the axis. | |||
|
252 | */ | |||
123 | void QChartAxis::setTicksCount(int count) |
|
253 | void QChartAxis::setTicksCount(int count) | |
124 | { |
|
254 | { | |
125 | m_ticksCount=count; |
|
255 | m_ticksCount=count; | |
126 | emit ticksChanged(this); |
|
256 | emit ticksChanged(this); | |
127 | } |
|
257 | } | |
128 |
|
258 | |||
|
259 | /*! | |||
|
260 | TODO: refactor me. Sets string \a label for \a value on the axis. | |||
|
261 | */ | |||
129 | void QChartAxis::addAxisTickLabel(qreal value,const QString& label) |
|
262 | void QChartAxis::addAxisTickLabel(qreal value,const QString& label) | |
130 | { |
|
263 | { | |
131 | m_ticks.insert(value,label); |
|
264 | m_ticks.insert(value,label); | |
132 | emit ticksChanged(this); |
|
265 | emit ticksChanged(this); | |
133 | } |
|
266 | } | |
134 |
|
267 | |||
|
268 | /*! | |||
|
269 | TODO: refactor me. Removes label for \a value on the axis. | |||
|
270 | */ | |||
135 | void QChartAxis::removeAxisTickLabel(qreal value) |
|
271 | void QChartAxis::removeAxisTickLabel(qreal value) | |
136 | { |
|
272 | { | |
137 | m_ticks.remove(value); |
|
273 | m_ticks.remove(value); | |
138 | emit ticksChanged(this); |
|
274 | emit ticksChanged(this); | |
139 | } |
|
275 | } | |
140 |
|
276 | |||
|
277 | /*! | |||
|
278 | TODO: refactor me. Returns label for \a value on the axis. | |||
|
279 | */ | |||
141 | QString QChartAxis::axisTickLabel(qreal value) const |
|
280 | QString QChartAxis::axisTickLabel(qreal value) const | |
142 | { |
|
281 | { | |
143 | return m_ticks.value(value); |
|
282 | return m_ticks.value(value); | |
144 | } |
|
283 | } | |
145 |
|
284 | |||
|
285 | /*! | |||
|
286 | TODO: refactor me. Removes all the string labels for on the axis. | |||
|
287 | */ | |||
146 | void QChartAxis::clearAxisTickLabels() |
|
288 | void QChartAxis::clearAxisTickLabels() | |
147 | { |
|
289 | { | |
148 | m_ticks.clear(); |
|
290 | m_ticks.clear(); |
@@ -20,8 +20,6 public: | |||||
20 | void setAxisVisible(bool visible); |
|
20 | void setAxisVisible(bool visible); | |
21 | void setAxisPen(const QPen& pen); |
|
21 | void setAxisPen(const QPen& pen); | |
22 | QPen axisPen() const { return m_axisPen;}; |
|
22 | QPen axisPen() const { return m_axisPen;}; | |
23 | void setAxisBrush(const QBrush& brush); |
|
|||
24 | QBrush axisBrush() const { return m_axisBrush;}; |
|
|||
25 |
|
23 | |||
26 | //grid handling |
|
24 | //grid handling | |
27 | bool isGridVisible() const { return m_gridVisible;}; |
|
25 | bool isGridVisible() const { return m_gridVisible;}; | |
@@ -37,7 +35,7 public: | |||||
37 | void setLabelsBrush(const QBrush& brush); |
|
35 | void setLabelsBrush(const QBrush& brush); | |
38 | QBrush labelsBrush() const { return m_labelsBrush;} |
|
36 | QBrush labelsBrush() const { return m_labelsBrush;} | |
39 | void setLabelsFont(const QFont& font); |
|
37 | void setLabelsFont(const QFont& font); | |
40 | QFont labelFont() const { return m_labelsFont;} |
|
38 | QFont labelsFont() const { return m_labelsFont;} | |
41 | void setLabelsAngle(int angle); |
|
39 | void setLabelsAngle(int angle); | |
42 | int labelsAngle() const { return m_labelsAngle;}; |
|
40 | int labelsAngle() const { return m_labelsAngle;}; | |
43 |
|
41 |
1 | NO CONTENT: file was removed, binary diff hidden |
|
NO CONTENT: file was removed, binary diff hidden |
1 | NO CONTENT: file was removed, binary diff hidden |
|
NO CONTENT: file was removed, binary diff hidden |
1 | NO CONTENT: file was removed, binary diff hidden |
|
NO CONTENT: file was removed, binary diff hidden |
1 | NO CONTENT: file was removed, binary diff hidden |
|
NO CONTENT: file was removed, binary diff hidden |
1 | NO CONTENT: file was removed, binary diff hidden |
|
NO CONTENT: file was removed, binary diff hidden |
1 | NO CONTENT: file was removed, binary diff hidden |
|
NO CONTENT: file was removed, binary diff hidden |
1 | NO CONTENT: file was removed, binary diff hidden |
|
NO CONTENT: file was removed, binary diff hidden |
1 | NO CONTENT: file was removed, binary diff hidden |
|
NO CONTENT: file was removed, binary diff hidden |
1 | NO CONTENT: file was removed, binary diff hidden |
|
NO CONTENT: file was removed, binary diff hidden |
1 | NO CONTENT: file was removed, binary diff hidden |
|
NO CONTENT: file was removed, binary diff hidden |
1 | NO CONTENT: file was removed, binary diff hidden |
|
NO CONTENT: file was removed, binary diff hidden |
1 | NO CONTENT: file was removed, binary diff hidden |
|
NO CONTENT: file was removed, binary diff hidden |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
General Comments 0
You need to be logged in to leave comments.
Login now