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