@@ -2,7 +2,6 | |||||
2 | Commercial Charts Add-on Preview |
|
2 | Commercial Charts Add-on Preview | |
3 | -------------------------------- |
|
3 | -------------------------------- | |
4 |
|
4 | |||
5 |
|
||||
6 | Whats in Qt Commercial Charts |
|
5 | Whats in Qt Commercial Charts | |
7 | ============================= |
|
6 | ============================= | |
8 |
|
7 | |||
@@ -19,19 +18,25 demos/ | |||||
19 | combine several chart types and implement interaction in charts |
|
18 | combine several chart types and implement interaction in charts | |
20 | doc/ |
|
19 | doc/ | |
21 | Documentation |
|
20 | Documentation | |
22 |
|
|
21 | licenses/ | |
23 | Licensing infromation |
|
22 | Licensing infromation | |
24 |
|
23 | |||
25 |
|
24 | Building | ||
26 | Building |
|
|||
27 | ======== |
|
25 | ======== | |
28 |
|
26 | |||
29 | qmake |
|
27 | Configure project with qmake: | |
30 | make (linux), mingw32-make (Windows with MinGw) or nmake (Visual Studio) |
|
28 | qmake CONFIG+=release | |
|
29 | ||||
|
30 | Build poject with make: | |||
|
31 | (Linux) make | |||
|
32 | (Windows with MinGw) mingw32-make | |||
|
33 | (Visual Studio) namke | |||
31 |
|
34 | |||
32 | If you want to install the libraries to your Qt library directory use: |
|
35 | If you want to install the libraries to your Qt library directory use: | |
33 | make install |
|
36 | make install | |
34 |
|
37 | |||
|
38 | If you want to uninstall the libraries | |||
|
39 | make uninstall | |||
35 |
|
40 | |||
36 | Documentation |
|
41 | Documentation | |
37 | ============= |
|
42 | ============= | |
@@ -41,27 +46,15 into "doc/html" in the build directory. | |||||
41 |
|
46 | |||
42 | KNOWN ISSUES |
|
47 | KNOWN ISSUES | |
43 | ============ |
|
48 | ============ | |
44 | - General |
|
49 | * The preview version of Qt Commercial Charts is still under development | |
45 | * The preview version of Qt Commercial Charts is still under development |
|
|||
46 | and thus should not be used in e.g. product development |
|
50 | and thus should not be used in e.g. product development | |
47 |
|
|
51 | * The Charts API might change between the Preview and first official release | |
48 |
|
|
52 | * Some areas will be refactored before the first official release | |
49 |
|
|
53 | * Qt Designer plugin is missing | |
50 |
|
|
54 | * Enable/disable tooltip is missing from the API | |
51 |
|
55 | * Mutliple axis are not suported at the moment. | ||
52 | - QML API |
|
56 | * Logartmic, polar axis are not supported at the moment. | |
53 | * The QML Bindings are still under development and to be considered as early preview |
|
57 | * Getting data from QAbstractItemModel is not feature complete. | |
54 | * All the current QML APIs are shown in qmlchart demo app |
|
58 | * Interlnal layout hadnling is not working properly. | |
55 | * If doing a developer build (not installing into your Qt instance) you |
|
59 | * The QML Bindings are still under development and to be considered as early draft | |
56 | need to copy qmldir file to the qmlplugin installation folder; it is not |
|
60 | * All the current QML APIs are shown in qmlchart demo app No newline at end of file | |
57 | copied during build. |
|
|||
58 |
|
||||
59 | - Model based |
|
|||
60 |
|
||||
61 | - Bar Chart |
|
|||
62 | * Modifying bar categories is not possible |
|
|||
63 |
|
||||
64 | - Pie Chart |
|
|||
65 | * Slice labels drawn on top of the label arm |
|
|||
66 |
|
||||
67 | - Line Chart |
|
1 | NO CONTENT: file renamed from Licenses/LICENSE-ALLOS to licenses/LICENSE-ALLOS |
|
NO CONTENT: file renamed from Licenses/LICENSE-ALLOS to licenses/LICENSE-ALLOS |
1 | NO CONTENT: file renamed from Licenses/LICENSE-ALLOS-US to licenses/LICENSE-ALLOS-US |
|
NO CONTENT: file renamed from Licenses/LICENSE-ALLOS-US to licenses/LICENSE-ALLOS-US |
1 | NO CONTENT: file renamed from Licenses/LICENSE-DESKTOP to licenses/LICENSE-DESKTOP |
|
NO CONTENT: file renamed from Licenses/LICENSE-DESKTOP to licenses/LICENSE-DESKTOP |
1 | NO CONTENT: file renamed from Licenses/LICENSE-DESKTOP-US to licenses/LICENSE-DESKTOP-US |
|
NO CONTENT: file renamed from Licenses/LICENSE-DESKTOP-US to licenses/LICENSE-DESKTOP-US |
1 | NO CONTENT: file renamed from Licenses/LICENSE-EVALUATION to licenses/LICENSE-EVALUATION |
|
NO CONTENT: file renamed from Licenses/LICENSE-EVALUATION to licenses/LICENSE-EVALUATION |
1 | NO CONTENT: file renamed from Licenses/LICENSE-EVALUATION-US to licenses/LICENSE-EVALUATION-US |
|
NO CONTENT: file renamed from Licenses/LICENSE-EVALUATION-US to licenses/LICENSE-EVALUATION-US |
1 | NO CONTENT: file renamed from Licenses/LICENSE.COMMERCIAL.FI to licenses/LICENSE.COMMERCIAL.FI |
|
NO CONTENT: file renamed from Licenses/LICENSE.COMMERCIAL.FI to licenses/LICENSE.COMMERCIAL.FI |
1 | NO CONTENT: file renamed from Licenses/LICENSE.COMMERCIAL.US to licenses/LICENSE.COMMERCIAL.US |
|
NO CONTENT: file renamed from Licenses/LICENSE.COMMERCIAL.US to licenses/LICENSE.COMMERCIAL.US |
@@ -139,9 +139,9 void Scroller::mouseReleaseEvent(QGraphicsSceneMouseEvent* event) | |||||
139 | m_state = Idle; |
|
139 | m_state = Idle; | |
140 | } |
|
140 | } | |
141 | else { |
|
141 | else { | |
142 |
m_speed /= |
|
142 | m_speed /= 3.75; | |
143 | m_state = Scroll; |
|
143 | m_state = Scroll; | |
144 |
m_ticker.start(2 |
|
144 | m_ticker.start(25); | |
145 | } |
|
145 | } | |
146 | event->accept(); |
|
146 | event->accept(); | |
147 | break; |
|
147 | break; |
@@ -100,24 +100,19 QSplineSeriesPrivate::QSplineSeriesPrivate(QSplineSeries* q):QLineSeriesPrivate( | |||||
100 | }; |
|
100 | }; | |
101 |
|
101 | |||
102 | /*! |
|
102 | /*! | |
103 | \internal |
|
|||
104 | Calculates control points which are needed by QPainterPath.cubicTo function to draw the cubic Bezier cureve between two points. |
|
103 | Calculates control points which are needed by QPainterPath.cubicTo function to draw the cubic Bezier cureve between two points. | |
105 | */ |
|
104 | */ | |
106 | void QSplineSeriesPrivate::calculateControlPoints() |
|
105 | void QSplineSeriesPrivate::calculateControlPoints() | |
107 | { |
|
106 | { | |
108 |
|
107 | |||
109 | Q_Q(QSplineSeries); |
|
108 | Q_Q(QSplineSeries); | |
110 | // Based on http://www.codeproject.com/Articles/31859/Draw-a-Smooth-Curve-through-a-Set-of-2D-Points-wit |
|
|||
111 | // CPOL License |
|
|||
112 |
|
109 | |||
113 | int n = q->count() - 1; |
|
110 | int n = q->count() - 1; | |
|
111 | ||||
114 | if (n == 1) |
|
112 | if (n == 1) | |
115 | { // Special case: Bezier curve should be a straight line. |
|
113 | { | |
116 | // firstControlPoints = new Point[1]; |
|
114 | //for n==1 | |
117 | // 3P1 = 2P0 + P3 |
|
|||
118 | m_controlPoints.append(QPointF((2 * q->x(0) + q->x(1)) / 3, (2 * q->y(0) + q->y(1)) / 3)); |
|
115 | m_controlPoints.append(QPointF((2 * q->x(0) + q->x(1)) / 3, (2 * q->y(0) + q->y(1)) / 3)); | |
119 |
|
||||
120 | // P2 = 2P1 P0 |
|
|||
121 | m_controlPoints.append(QPointF(2 * m_controlPoints[0].x() - q->x(0), 2 * m_controlPoints[0].y() - q->y(0))); |
|
116 | m_controlPoints.append(QPointF(2 * m_controlPoints[0].x() - q->x(0), 2 * m_controlPoints[0].y() - q->y(0))); | |
122 | return; |
|
117 | return; | |
123 | } |
|
118 | } | |
@@ -135,31 +130,31 void QSplineSeriesPrivate::calculateControlPoints() | |||||
135 | // | 0 0 0 0 0 0 0 0 ... 1 4 1 | | P1_(n-1)| | 4 * P(n-2) + 2 * P(n-1) | |
|
130 | // | 0 0 0 0 0 0 0 0 ... 1 4 1 | | P1_(n-1)| | 4 * P(n-2) + 2 * P(n-1) | | |
136 | // | 0 0 0 0 0 0 0 0 ... 0 2 7 | | P1_n | | 8 * P(n-1) + Pn | |
|
131 | // | 0 0 0 0 0 0 0 0 ... 0 2 7 | | P1_n | | 8 * P(n-1) + Pn | | |
137 | // |
|
132 | // | |
138 |
QList<qreal> |
|
133 | QList<qreal> points; | |
139 | rhs.append(q->x(0) + 2 * q->x(1)); |
|
|||
140 |
|
134 | |||
141 | // Set right hand side X values |
|
135 | points.append(q->x(0) + 2 * q->x(1)); | |
142 | for (int i = 1; i < n - 1; ++i) |
|
|||
143 | rhs.append(4 * q->x(i) + 2 * q->x(i + 1)); |
|
|||
144 |
|
136 | |||
145 | rhs.append((8 * q->x(n - 1) + q->x(n)) / 2.0); |
|
|||
146 | // Get first control points X-values |
|
|||
147 | QList<qreal> xControl = getFirstControlPoints(rhs); |
|
|||
148 | rhs[0] = q->y(0) + 2 * q->y(1); |
|
|||
149 |
|
137 | |||
150 | // Set right hand side Y values |
|
|||
151 | for (int i = 1; i < n - 1; ++i) |
|
138 | for (int i = 1; i < n - 1; ++i) | |
152 |
|
|
139 | points.append(4 * q->x(i) + 2 * q->x(i + 1)); | |
|
140 | ||||
|
141 | points.append((8 * q->x(n - 1) + q->x(n)) / 2.0); | |||
|
142 | ||||
|
143 | QList<qreal> xControl = firstControlPoints(points); | |||
|
144 | points[0] = q->y(0) + 2 * q->y(1); | |||
|
145 | ||||
|
146 | for (int i = 1; i < n - 1; ++i) { | |||
|
147 | points[i] = 4 * q->y(i) + 2 * q->y(i + 1); | |||
|
148 | } | |||
|
149 | ||||
|
150 | points[n - 1] = (8 * q->y(n - 1) + q->y(n)) / 2.0; | |||
153 |
|
151 | |||
154 | rhs[n - 1] = (8 * q->y(n - 1) + q->y(n)) / 2.0; |
|
152 | QList<qreal> yControl = firstControlPoints(points); | |
155 | // Get first control points Y-values |
|
|||
156 | QList<qreal> yControl = getFirstControlPoints(rhs); |
|
|||
157 |
|
153 | |||
158 | // Fill output arrays. |
|
|||
159 | for (int i = 0; i < n; ++i) { |
|
154 | for (int i = 0; i < n; ++i) { | |
160 | // First control point |
|
155 | ||
161 | m_controlPoints.append(QPointF(xControl[i], yControl[i])); |
|
156 | m_controlPoints.append(QPointF(xControl[i], yControl[i])); | |
162 | // Second control point |
|
157 | ||
163 | if (i < n - 1) |
|
158 | if (i < n - 1) | |
164 | m_controlPoints.append(QPointF(2 * q->x(i + 1) - xControl[i + 1], 2 * q->y(i + 1) - yControl[i + 1])); |
|
159 | m_controlPoints.append(QPointF(2 * q->x(i + 1) - xControl[i + 1], 2 * q->y(i + 1) - yControl[i + 1])); | |
165 | else |
|
160 | else | |
@@ -167,31 +162,26 void QSplineSeriesPrivate::calculateControlPoints() | |||||
167 | } |
|
162 | } | |
168 | } |
|
163 | } | |
169 |
|
164 | |||
170 | /*! |
|
165 | QList<qreal> QSplineSeriesPrivate::firstControlPoints(QList<qreal> list) | |
171 | \internal |
|
|||
172 | */ |
|
|||
173 | QList<qreal> QSplineSeriesPrivate::getFirstControlPoints(QList<qreal> rhs) |
|
|||
174 | { |
|
166 | { | |
175 | QList<qreal> x; // Solution vector. |
|
167 | QList<qreal> result; | |
176 |
QList<qreal> tmp; |
|
168 | QList<qreal> temp; | |
177 |
|
169 | |||
178 | qreal b = 2.0; |
|
170 | qreal b = 2.0; | |
179 |
|
|
171 | result.append(list[0] / b); | |
180 | tmp.append(0); |
|
172 | temp.append(0); | |
181 |
for (int i = 1; i < |
|
173 | for (int i = 1; i < list.size(); i++) { | |
182 | // Decomposition and forward substitution. |
|
174 | temp.append(1 / b); | |
183 | tmp.append(1 / b); |
|
175 | b = (i < list.size() - 1 ? 4.0 : 3.5) - temp[i]; | |
184 | b = (i < rhs.size() - 1 ? 4.0 : 3.5) - tmp[i]; |
|
176 | result.append((list[i] - result[i - 1]) / b); | |
185 | x.append((rhs[i] - x[i - 1]) / b); |
|
|||
186 | } |
|
177 | } | |
187 |
for (int i = 1; i < |
|
178 | for (int i = 1; i < list.size(); i++) | |
188 |
|
|
179 | result[list.size() - i - 1] -= temp[list.size() - i] * result[list.size() - i]; | |
189 |
|
180 | |||
190 |
return |
|
181 | return result; | |
191 | } |
|
182 | } | |
192 |
|
183 | |||
193 | /*! |
|
184 | /*! | |
194 | \internal |
|
|||
195 | Updates the control points, besed on currently avaiable knots. |
|
185 | Updates the control points, besed on currently avaiable knots. | |
196 | */ |
|
186 | */ | |
197 | void QSplineSeriesPrivate::updateControlPoints() |
|
187 | void QSplineSeriesPrivate::updateControlPoints() |
@@ -42,7 +42,7 public: | |||||
42 | Chart* createGraphics(ChartPresenter* presenter); |
|
42 | Chart* createGraphics(ChartPresenter* presenter); | |
43 | QSplineSeriesPrivate(QSplineSeries* q); |
|
43 | QSplineSeriesPrivate(QSplineSeries* q); | |
44 | void calculateControlPoints(); |
|
44 | void calculateControlPoints(); | |
45 |
QList<qreal> |
|
45 | QList<qreal> firstControlPoints(QList<qreal> rhs); | |
46 |
|
46 | |||
47 | public Q_SLOTS: |
|
47 | public Q_SLOTS: | |
48 | void updateControlPoints(); |
|
48 | void updateControlPoints(); |
General Comments 0
You need to be logged in to leave comments.
Login now