##// END OF EJS Templates
color and borderColor properties to XY charts; removed unnecessary signals
Tero Ahola -
r1481:3fafc6aab8aa
parent child
Show More
@@ -64,30 +64,6 DeclarativeLineSeries* DeclarativeAreaSeries::lowerSeries() const
64 return qobject_cast<DeclarativeLineSeries *>(QAreaSeries::lowerSeries());
64 return qobject_cast<DeclarativeLineSeries *>(QAreaSeries::lowerSeries());
65 }
65 }
66
66
67 QColor DeclarativeAreaSeries::penColor() const
68 {
69 return pen().color();
70 }
71
72 void DeclarativeAreaSeries::setPenColor(QColor color)
73 {
74 QPen p = pen();
75 p.setColor(color);
76 setPen(p);
77 }
78
79 QColor DeclarativeAreaSeries::brushColor() const
80 {
81 return brush().color();
82 }
83
84 void DeclarativeAreaSeries::setBrushColor(QColor color)
85 {
86 QBrush b = brush();
87 b.setColor(color);
88 setBrush(b);
89 }
90
91 #include "moc_declarativeareaseries.cpp"
67 #include "moc_declarativeareaseries.cpp"
92
68
93 QTCOMMERCIALCHART_END_NAMESPACE
69 QTCOMMERCIALCHART_END_NAMESPACE
@@ -32,8 +32,6 class DeclarativeAreaSeries : public QAreaSeries
32 Q_OBJECT
32 Q_OBJECT
33 Q_PROPERTY(DeclarativeLineSeries *upperSeries READ upperSeries WRITE setUpperSeries)
33 Q_PROPERTY(DeclarativeLineSeries *upperSeries READ upperSeries WRITE setUpperSeries)
34 Q_PROPERTY(DeclarativeLineSeries *lowerSeries READ lowerSeries WRITE setLowerSeries)
34 Q_PROPERTY(DeclarativeLineSeries *lowerSeries READ lowerSeries WRITE setLowerSeries)
35 Q_PROPERTY(QColor color READ brushColor WRITE setBrushColor)
36 Q_PROPERTY(QColor borderColor READ penColor WRITE setPenColor)
37
35
38 public:
36 public:
39 explicit DeclarativeAreaSeries(QObject *parent = 0);
37 explicit DeclarativeAreaSeries(QObject *parent = 0);
@@ -41,10 +39,6 public:
41 DeclarativeLineSeries* upperSeries() const;
39 DeclarativeLineSeries* upperSeries() const;
42 void setLowerSeries(DeclarativeLineSeries* series);
40 void setLowerSeries(DeclarativeLineSeries* series);
43 DeclarativeLineSeries* lowerSeries() const;
41 DeclarativeLineSeries* lowerSeries() const;
44 QColor penColor() const;
45 void setPenColor(QColor color);
46 QColor brushColor() const;
47 void setBrushColor(QColor color);
48 };
42 };
49
43
50 QTCOMMERCIALCHART_END_NAMESPACE
44 QTCOMMERCIALCHART_END_NAMESPACE
@@ -160,10 +160,8 void DeclarativeChart::paint(QPainter *painter, const QStyleOptionGraphicsItem *
160 void DeclarativeChart::setTheme(DeclarativeChart::Theme theme)
160 void DeclarativeChart::setTheme(DeclarativeChart::Theme theme)
161 {
161 {
162 QChart::ChartTheme chartTheme = (QChart::ChartTheme) theme;
162 QChart::ChartTheme chartTheme = (QChart::ChartTheme) theme;
163 if (chartTheme != m_chart->theme()) {
163 if (chartTheme != m_chart->theme())
164 m_chart->setTheme(chartTheme);
164 m_chart->setTheme(chartTheme);
165 themeChanged();
166 }
167 }
165 }
168
166
169 DeclarativeChart::Theme DeclarativeChart::theme()
167 DeclarativeChart::Theme DeclarativeChart::theme()
@@ -174,10 +172,8 DeclarativeChart::Theme DeclarativeChart::theme()
174 void DeclarativeChart::setAnimationOptions(DeclarativeChart::Animation animations)
172 void DeclarativeChart::setAnimationOptions(DeclarativeChart::Animation animations)
175 {
173 {
176 QChart::AnimationOption animationOptions = (QChart::AnimationOption) animations;
174 QChart::AnimationOption animationOptions = (QChart::AnimationOption) animations;
177 if (animationOptions != m_chart->animationOptions()) {
175 if (animationOptions != m_chart->animationOptions())
178 m_chart->setAnimationOptions(animationOptions);
176 m_chart->setAnimationOptions(animationOptions);
179 animationOptionsChanged();
180 }
181 }
177 }
182
178
183 DeclarativeChart::Animation DeclarativeChart::animationOptions()
179 DeclarativeChart::Animation DeclarativeChart::animationOptions()
@@ -194,10 +190,8 DeclarativeChart::Animation DeclarativeChart::animationOptions()
194
190
195 void DeclarativeChart::setTitle(QString title)
191 void DeclarativeChart::setTitle(QString title)
196 {
192 {
197 if (title != m_chart->title()) {
193 if (title != m_chart->title())
198 m_chart->setTitle(title);
194 m_chart->setTitle(title);
199 emit titleChanged();
200 }
201 }
195 }
202 QString DeclarativeChart::title()
196 QString DeclarativeChart::title()
203 {
197 {
@@ -34,9 +34,9 class DeclarativeChart : public QDeclarativeItem
34 //class DeclarativeChart : public QQuickPaintedItem, public Chart
34 //class DeclarativeChart : public QQuickPaintedItem, public Chart
35 {
35 {
36 Q_OBJECT
36 Q_OBJECT
37 Q_PROPERTY(Theme theme READ theme WRITE setTheme NOTIFY themeChanged)
37 Q_PROPERTY(Theme theme READ theme WRITE setTheme)
38 Q_PROPERTY(Animation animationOptions READ animationOptions WRITE setAnimationOptions NOTIFY animationOptionsChanged)
38 Q_PROPERTY(Animation animationOptions READ animationOptions WRITE setAnimationOptions)
39 Q_PROPERTY(QString title READ title WRITE setTitle NOTIFY titleChanged)
39 Q_PROPERTY(QString title READ title WRITE setTitle)
40 Q_PROPERTY(QColor titleColor READ titleColor WRITE setTitleColor NOTIFY titleColorChanged)
40 Q_PROPERTY(QColor titleColor READ titleColor WRITE setTitleColor NOTIFY titleColorChanged)
41 Q_PROPERTY(QAxis *axisX READ axisX)
41 Q_PROPERTY(QAxis *axisX READ axisX)
42 Q_PROPERTY(QAxis *axisY READ axisY)
42 Q_PROPERTY(QAxis *axisY READ axisY)
@@ -120,9 +120,6 public:
120 Q_INVOKABLE QAbstractSeries *createSeries(DeclarativeChart::SeriesType type, QString name = "");
120 Q_INVOKABLE QAbstractSeries *createSeries(DeclarativeChart::SeriesType type, QString name = "");
121
121
122 Q_SIGNALS:
122 Q_SIGNALS:
123 void themeChanged();
124 void animationOptionsChanged();
125 void titleChanged();
126 void axisLabelsChanged();
123 void axisLabelsChanged();
127 void titleColorChanged();
124 void titleColorChanged();
128 void backgroundColorChanged();
125 void backgroundColorChanged();
@@ -34,7 +34,6 class DeclarativeLineSeries : public QLineSeries, public DeclarativeXySeries, pu
34 {
34 {
35 Q_OBJECT
35 Q_OBJECT
36 Q_INTERFACES(QDeclarativeParserStatus)
36 Q_INTERFACES(QDeclarativeParserStatus)
37 Q_PROPERTY(QColor color READ penColor WRITE setPenColor)
38 Q_PROPERTY(int count READ count NOTIFY countChanged)
37 Q_PROPERTY(int count READ count NOTIFY countChanged)
39 Q_PROPERTY(QDeclarativeListProperty<QObject> declarativeChildren READ declarativeChildren)
38 Q_PROPERTY(QDeclarativeListProperty<QObject> declarativeChildren READ declarativeChildren)
40 Q_CLASSINFO("DefaultProperty", "declarativeChildren")
39 Q_CLASSINFO("DefaultProperty", "declarativeChildren")
@@ -68,18 +68,6 void DeclarativeScatterSeries::appendDeclarativeChildren(QDeclarativeListPropert
68 // Empty implementation, childs are parsed in componentComplete
68 // Empty implementation, childs are parsed in componentComplete
69 }
69 }
70
70
71 QColor DeclarativeScatterSeries::brushColor()
72 {
73 return brush().color();
74 }
75
76 void DeclarativeScatterSeries::setBrushColor(QColor color)
77 {
78 QBrush b = brush();
79 b.setColor(color);
80 setBrush(b);
81 }
82
83 #include "moc_declarativescatterseries.cpp"
71 #include "moc_declarativescatterseries.cpp"
84
72
85 QTCOMMERCIALCHART_END_NAMESPACE
73 QTCOMMERCIALCHART_END_NAMESPACE
@@ -33,8 +33,6 class DeclarativeScatterSeries : public QScatterSeries, public DeclarativeXySeri
33 {
33 {
34 Q_OBJECT
34 Q_OBJECT
35 Q_INTERFACES(QDeclarativeParserStatus)
35 Q_INTERFACES(QDeclarativeParserStatus)
36 Q_PROPERTY(QColor color READ brushColor WRITE setBrushColor)
37 Q_PROPERTY(QColor borderColor READ penColor WRITE setPenColor)
38 Q_PROPERTY(int count READ count NOTIFY countChanged)
36 Q_PROPERTY(int count READ count NOTIFY countChanged)
39 Q_PROPERTY(QDeclarativeListProperty<QObject> declarativeChildren READ declarativeChildren)
37 Q_PROPERTY(QDeclarativeListProperty<QObject> declarativeChildren READ declarativeChildren)
40 Q_CLASSINFO("DefaultProperty", "declarativeChildren")
38 Q_CLASSINFO("DefaultProperty", "declarativeChildren")
@@ -43,8 +41,6 public:
43 explicit DeclarativeScatterSeries(QObject *parent = 0);
41 explicit DeclarativeScatterSeries(QObject *parent = 0);
44 QXYSeries *xySeries();
42 QXYSeries *xySeries();
45 QDeclarativeListProperty<QObject> declarativeChildren();
43 QDeclarativeListProperty<QObject> declarativeChildren();
46 QColor brushColor();
47 void setBrushColor(QColor color);
48
44
49 public: // from QDeclarativeParserStatus
45 public: // from QDeclarativeParserStatus
50 void classBegin() { DeclarativeXySeries::classBegin(); }
46 void classBegin() { DeclarativeXySeries::classBegin(); }
@@ -34,7 +34,6 class DeclarativeSplineSeries : public QSplineSeries, public DeclarativeXySeries
34 {
34 {
35 Q_OBJECT
35 Q_OBJECT
36 Q_INTERFACES(QDeclarativeParserStatus)
36 Q_INTERFACES(QDeclarativeParserStatus)
37 Q_PROPERTY(QColor color READ penColor WRITE setPenColor)
38 Q_PROPERTY(QDeclarativeListProperty<QObject> declarativeChildren READ declarativeChildren)
37 Q_PROPERTY(QDeclarativeListProperty<QObject> declarativeChildren READ declarativeChildren)
39 Q_CLASSINFO("DefaultProperty", "declarativeChildren")
38 Q_CLASSINFO("DefaultProperty", "declarativeChildren")
40
39
@@ -59,23 +59,6 void DeclarativeXySeries::componentComplete()
59 }
59 }
60 }
60 }
61
61
62 QColor DeclarativeXySeries::penColor()
63 {
64 // All the inherited objects must be of type QXYSeries, so it is safe to cast
65 QXYSeries *series = qobject_cast<QXYSeries *>(xySeries());
66 Q_ASSERT(series);
67 return series->pen().color();
68 }
69
70 void DeclarativeXySeries::setPenColor(QColor color)
71 {
72 QXYSeries *series = qobject_cast<QXYSeries *>(xySeries());
73 Q_ASSERT(series);
74 QPen pen = series->pen();
75 pen.setColor(color);
76 series->setPen(pen);
77 }
78
79 DeclarativeXyPoint *DeclarativeXySeries::at(int index)
62 DeclarativeXyPoint *DeclarativeXySeries::at(int index)
80 {
63 {
81 QXYSeries *series = qobject_cast<QXYSeries *>(xySeries());
64 QXYSeries *series = qobject_cast<QXYSeries *>(xySeries());
@@ -41,8 +41,6 public:
41 void classBegin();
41 void classBegin();
42 void componentComplete();
42 void componentComplete();
43 virtual QXYSeries *xySeries() = 0;
43 virtual QXYSeries *xySeries() = 0;
44 QColor penColor();
45 void setPenColor(QColor color);
46 DeclarativeXyPoint *at(int index);
44 DeclarativeXyPoint *at(int index);
47 };
45 };
48
46
@@ -58,6 +58,18 QTCOMMERCIALCHART_BEGIN_NAMESPACE
58 */
58 */
59
59
60 /*!
60 /*!
61 \property QAreaSeries::color
62 Fill (brush) color of the series. This is a convenience property for modifying the color of brush.
63 \sa QAreaSeries::brush()
64 */
65
66 /*!
67 \property QAreaSeries::borderColor
68 Line (pen) color of the series. This is a convenience property for modifying the color of pen.
69 \sa QAreaSeries::pen()
70 */
71
72 /*!
61 \fn QPen QAreaSeries::pen() const
73 \fn QPen QAreaSeries::pen() const
62 \brief Returns the pen used to draw line for this series.
74 \brief Returns the pen used to draw line for this series.
63 \sa setPen()
75 \sa setPen()
@@ -70,6 +82,16 QTCOMMERCIALCHART_BEGIN_NAMESPACE
70 */
82 */
71
83
72 /*!
84 /*!
85 \fn void QAreaSeries::colorChanged(QColor color)
86 \brief Signal is emitted when the fill (brush) color has changed to \a color.
87 */
88
89 /*!
90 \fn void QAreaSeries::borderColorChanged(QColor color)
91 \brief Signal is emitted when the line (pen) color has changed to \a color.
92 */
93
94 /*!
73 \fn bool QAreaSeries::pointsVisible() const
95 \fn bool QAreaSeries::pointsVisible() const
74 \brief Returns if the points are drawn for this series.
96 \brief Returns if the points are drawn for this series.
75 \sa setPointsVisible()
97 \sa setPointsVisible()
@@ -191,6 +213,37 QBrush QAreaSeries::brush() const
191 Q_D(const QAreaSeries);
213 Q_D(const QAreaSeries);
192 return d->m_brush;
214 return d->m_brush;
193 }
215 }
216
217 void QAreaSeries::setColor(const QColor &color)
218 {
219 QBrush b = brush();
220 if (b.color() != color) {
221 b.setColor(color);
222 setBrush(b);
223 emit colorChanged(color);
224 }
225 }
226
227 QColor QAreaSeries::color() const
228 {
229 return brush().color();
230 }
231
232 void QAreaSeries::setBorderColor(const QColor &color)
233 {
234 QPen p = pen();
235 if (p.color() != color) {
236 p.setColor(color);
237 setPen(p);
238 emit borderColorChanged(color);
239 }
240 }
241
242 QColor QAreaSeries::borderColor() const
243 {
244 return pen().color();
245 }
246
194 /*!
247 /*!
195 Sets if data points are \a visible and should be drawn on line.
248 Sets if data points are \a visible and should be drawn on line.
196 */
249 */
@@ -35,6 +35,8 class QTCOMMERCIALCHART_EXPORT QAreaSeries : public QAbstractSeries
35 Q_OBJECT
35 Q_OBJECT
36 Q_PROPERTY(QAbstractSeries *upperSeries READ upperSeries)
36 Q_PROPERTY(QAbstractSeries *upperSeries READ upperSeries)
37 Q_PROPERTY(QAbstractSeries *lowerSeries READ lowerSeries)
37 Q_PROPERTY(QAbstractSeries *lowerSeries READ lowerSeries)
38 Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged)
39 Q_PROPERTY(QColor borderColor READ borderColor WRITE setBorderColor NOTIFY borderColorChanged)
38
40
39 public:
41 public:
40 explicit QAreaSeries(QObject *parent = 0);
42 explicit QAreaSeries(QObject *parent = 0);
@@ -55,16 +57,24 public:
55 void setBrush(const QBrush &brush);
57 void setBrush(const QBrush &brush);
56 QBrush brush() const;
58 QBrush brush() const;
57
59
60 void setColor(const QColor &color);
61 QColor color() const;
62
63 void setBorderColor(const QColor &color);
64 QColor borderColor() const;
65
58 void setPointsVisible(bool visible = true);
66 void setPointsVisible(bool visible = true);
59 bool pointsVisible() const;
67 bool pointsVisible() const;
60
68
61 Q_SIGNALS:
69 Q_SIGNALS:
62 void clicked(const QPointF &point);
70 void clicked(const QPointF &point);
63 void selected();
71 void selected();
72 void colorChanged(QColor color);
73 void borderColorChanged(QColor color);
64
74
65 private:
75 private:
66 Q_DECLARE_PRIVATE(QAreaSeries);
76 Q_DECLARE_PRIVATE(QAreaSeries)
67 Q_DISABLE_COPY(QAreaSeries);
77 Q_DISABLE_COPY(QAreaSeries)
68 friend class AreaLegendMarker;
78 friend class AreaLegendMarker;
69 friend class AreaChartItem;
79 friend class AreaChartItem;
70 };
80 };
@@ -218,11 +218,6 QTCOMMERCIALCHART_BEGIN_NAMESPACE
218 */
218 */
219
219
220 /*!
220 /*!
221 \fn void QAxis::labelsAngleChanged(int)
222 Emitted if the \a angle of the axis labels is changed.
223 */
224
225 /*!
226 \fn void QAxis::shadesVisibleChanged(bool)
221 \fn void QAxis::shadesVisibleChanged(bool)
227 Emitted if the visibility of the axis shades is changed to \a visible.
222 Emitted if the visibility of the axis shades is changed to \a visible.
228 */
223 */
@@ -238,18 +233,6 QTCOMMERCIALCHART_BEGIN_NAMESPACE
238 */
233 */
239
234
240 /*!
235 /*!
241 \fn void QAxis::ticksCountChanged(int count)
242 \brief Emits the new \a count of ticks on the axis
243 Signal is emitted when the number of the ticks on the axis has been changed to a different value.
244 Parementer count\a count is the new number of ticks on the axis.
245 */
246
247 /*!
248 \fn void QAxis::niceNumbersEnabledChanged(bool)
249 Nice numbers algorithm was \a enabled or disabled.
250 */
251
252 /*!
253 Constructs new axis object which is a child of \a parent. Ownership is taken by
236 Constructs new axis object which is a child of \a parent. Ownership is taken by
254 QChart when axis added.
237 QChart when axis added.
255 */
238 */
@@ -427,7 +410,6 void QAxis::setLabelsAngle(int angle)
427 if (d_ptr->m_labelsAngle != angle) {
410 if (d_ptr->m_labelsAngle != angle) {
428 d_ptr->m_labelsAngle = angle;
411 d_ptr->m_labelsAngle = angle;
429 emit d_ptr->updated();
412 emit d_ptr->updated();
430 emit labelsAngleChanged(angle);
431 }
413 }
432 }
414 }
433
415
@@ -579,7 +561,6 void QAxis::setTicksCount(int count)
579 {
561 {
580 if (d_ptr->m_ticksCount != count) {
562 if (d_ptr->m_ticksCount != count) {
581 d_ptr->m_ticksCount = count;
563 d_ptr->m_ticksCount = count;
582 emit ticksCountChanged(count);
583 emit d_ptr->changed(d_ptr->m_min, d_ptr->m_max, d_ptr->m_ticksCount, d_ptr->m_niceNumbers);
564 emit d_ptr->changed(d_ptr->m_min, d_ptr->m_max, d_ptr->m_ticksCount, d_ptr->m_niceNumbers);
584 }
565 }
585 }
566 }
@@ -622,7 +603,6 void QAxis::setNiceNumbersEnabled(bool enable)
622 if (d_ptr->m_niceNumbers != enable){
603 if (d_ptr->m_niceNumbers != enable){
623 d_ptr->m_niceNumbers = enable;
604 d_ptr->m_niceNumbers = enable;
624 emit d_ptr->changed(d_ptr->m_min, d_ptr->m_max, d_ptr->m_ticksCount, d_ptr->m_niceNumbers);
605 emit d_ptr->changed(d_ptr->m_min, d_ptr->m_max, d_ptr->m_ticksCount, d_ptr->m_niceNumbers);
625 emit niceNumbersEnabledChanged(enable);
626 }
606 }
627 }
607 }
628
608
@@ -36,7 +36,7 class QTCOMMERCIALCHART_EXPORT QAxis : public QObject
36 Q_PROPERTY(bool visible READ isAxisVisible WRITE setAxisVisible NOTIFY visibleChanged)
36 Q_PROPERTY(bool visible READ isAxisVisible WRITE setAxisVisible NOTIFY visibleChanged)
37 Q_PROPERTY(QColor color READ axisPenColor WRITE setAxisPenColor NOTIFY colorChanged)
37 Q_PROPERTY(QColor color READ axisPenColor WRITE setAxisPenColor NOTIFY colorChanged)
38 Q_PROPERTY(bool labelsVisible READ labelsVisible WRITE setLabelsVisible NOTIFY labelsVisibleChanged)
38 Q_PROPERTY(bool labelsVisible READ labelsVisible WRITE setLabelsVisible NOTIFY labelsVisibleChanged)
39 Q_PROPERTY(int labelsAngle READ labelsAngle WRITE setLabelsAngle NOTIFY labelsAngleChanged)
39 Q_PROPERTY(int labelsAngle READ labelsAngle WRITE setLabelsAngle)
40 Q_PROPERTY(QColor labelsColor READ labelsColor WRITE setLabelsColor NOTIFY labelsColorChanged)
40 Q_PROPERTY(QColor labelsColor READ labelsColor WRITE setLabelsColor NOTIFY labelsColorChanged)
41 Q_PROPERTY(bool gridVisible READ isGridLineVisible WRITE setGridLineVisible NOTIFY gridVisibleChanged)
41 Q_PROPERTY(bool gridVisible READ isGridLineVisible WRITE setGridLineVisible NOTIFY gridVisibleChanged)
42 Q_PROPERTY(bool shadesVisible READ shadesVisible WRITE setShadesVisible NOTIFY shadesVisibleChanged)
42 Q_PROPERTY(bool shadesVisible READ shadesVisible WRITE setShadesVisible NOTIFY shadesVisibleChanged)
@@ -44,8 +44,8 class QTCOMMERCIALCHART_EXPORT QAxis : public QObject
44 Q_PROPERTY(QColor shadesBorderColor READ shadesBorderColor WRITE setShadesBorderColor NOTIFY shadesBorderColorChanged)
44 Q_PROPERTY(QColor shadesBorderColor READ shadesBorderColor WRITE setShadesBorderColor NOTIFY shadesBorderColorChanged)
45 Q_PROPERTY(qreal min READ min WRITE setMin NOTIFY minChanged)
45 Q_PROPERTY(qreal min READ min WRITE setMin NOTIFY minChanged)
46 Q_PROPERTY(qreal max READ max WRITE setMax NOTIFY maxChanged)
46 Q_PROPERTY(qreal max READ max WRITE setMax NOTIFY maxChanged)
47 Q_PROPERTY(int ticksCount READ ticksCount WRITE setTicksCount NOTIFY ticksCountChanged)
47 Q_PROPERTY(int ticksCount READ ticksCount WRITE setTicksCount)
48 Q_PROPERTY(bool niceNumbersEnabled READ niceNumbersEnabled WRITE setNiceNumbersEnabled NOTIFY niceNumbersEnabledChanged)
48 Q_PROPERTY(bool niceNumbersEnabled READ niceNumbersEnabled WRITE setNiceNumbersEnabled)
49
49
50 public:
50 public:
51
51
@@ -118,14 +118,11 Q_SIGNALS:
118 void rangeChanged(qreal min, qreal max);
118 void rangeChanged(qreal min, qreal max);
119 void colorChanged(QColor color);
119 void colorChanged(QColor color);
120 void labelsColorChanged(QColor color);
120 void labelsColorChanged(QColor color);
121 void labelsAngleChanged(int angle);
122 void shadesVisibleChanged(bool visible);
121 void shadesVisibleChanged(bool visible);
123 void shadesColorChanged(QColor color);
122 void shadesColorChanged(QColor color);
124 void shadesBorderColorChanged(QColor color);
123 void shadesBorderColorChanged(QColor color);
125 void minChanged(qreal min);
124 void minChanged(qreal min);
126 void maxChanged(qreal max);
125 void maxChanged(qreal max);
127 void ticksCountChanged(int count);
128 void niceNumbersEnabledChanged(bool enabled);
129
126
130 private:
127 private:
131 QScopedPointer<QAxisPrivate> d_ptr;
128 QScopedPointer<QAxisPrivate> d_ptr;
@@ -121,11 +121,6 QTCOMMERCIALCHART_BEGIN_NAMESPACE
121 */
121 */
122
122
123 /*!
123 /*!
124 \fn void QLegend::alignmentChanged(Qt::Alignment)
125 Emitted when the \a alignment of the legend changes.
126 */
127
128 /*!
129 \fn void QLegend::backgroundVisibleChanged(bool)
124 \fn void QLegend::backgroundVisibleChanged(bool)
130 The visibility of the legend background changed to \a visible.
125 The visibility of the legend background changed to \a visible.
131 */
126 */
@@ -271,7 +266,6 void QLegend::setAlignment(Qt::Alignment alignment)
271 if(d_ptr->m_alignment!=alignment) {
266 if(d_ptr->m_alignment!=alignment) {
272 d_ptr->m_alignment = alignment;
267 d_ptr->m_alignment = alignment;
273 d_ptr->updateLayout();
268 d_ptr->updateLayout();
274 alignmentChanged(alignment);
275 }
269 }
276 }
270 }
277
271
@@ -43,7 +43,7 class QLegendPrivate;
43 class QTCOMMERCIALCHART_EXPORT QLegend : public QGraphicsWidget
43 class QTCOMMERCIALCHART_EXPORT QLegend : public QGraphicsWidget
44 {
44 {
45 Q_OBJECT
45 Q_OBJECT
46 Q_PROPERTY(Qt::Alignment alignment READ alignment WRITE setAlignment NOTIFY alignmentChanged)
46 Q_PROPERTY(Qt::Alignment alignment READ alignment WRITE setAlignment)
47 Q_PROPERTY(bool backgroundVisible READ isBackgroundVisible WRITE setBackgroundVisible NOTIFY backgroundVisibleChanged)
47 Q_PROPERTY(bool backgroundVisible READ isBackgroundVisible WRITE setBackgroundVisible NOTIFY backgroundVisibleChanged)
48 Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged)
48 Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged)
49 Q_PROPERTY(QColor borderColor READ borderColor WRITE setBorderColor NOTIFY borderColorChanged)
49 Q_PROPERTY(QColor borderColor READ borderColor WRITE setBorderColor NOTIFY borderColorChanged)
@@ -86,7 +86,6 protected:
86 void showEvent(QShowEvent *event);
86 void showEvent(QShowEvent *event);
87
87
88 Q_SIGNALS:
88 Q_SIGNALS:
89 void alignmentChanged(Qt::Alignment alignment);
90 void backgroundVisibleChanged(bool visible);
89 void backgroundVisibleChanged(bool visible);
91 void colorChanged(QColor color);
90 void colorChanged(QColor color);
92 void borderColorChanged(QColor color);
91 void borderColorChanged(QColor color);
@@ -56,25 +56,37
56 */
56 */
57
57
58 /*!
58 /*!
59 \property QScatterSeries::markerShape
59 \property QScatterSeries::color
60
60 Fill (brush) color of the series. This is a convenience property for modifying the color of brush.
61 Defines the shape of the marker used to draw the points in the series.
61 \sa QScatterSeries::brush()
62 */
62 */
63
63
64 /*!
64 /*!
65 \fn void QScatterSeries::markerShapeChanged()
65 \property QScatterSeries::borderColor
66 Emitted when marker shape is changed
66 Line (pen) color of the series. This is a convenience property for modifying the color of pen.
67 \sa QScatterSeries::pen()
67 */
68 */
68
69
69 /*!
70 /*!
70 \fn void QScatterSeries::markerSizeChanged()
71 \property QScatterSeries::markerShape
71 Emitted when marker size is changed
72
73 Defines the shape of the marker used to draw the points in the series. The default shape is MarkerShapeCircle.
72 */
74 */
73
75
74 /*!
76 /*!
75 \property QScatterSeries::markerSize
77 \property QScatterSeries::markerSize
76
78
77 Defines the size of the marker used to draw the points in the series.
79 Defines the size of the marker used to draw the points in the series. The default size is 15.0.
80 */
81
82 /*!
83 \fn void QScatterSeries::colorChanged(QColor color)
84 \brief Signal is emitted when the fill (brush) color has changed to \a color.
85 */
86
87 /*!
88 \fn void QScatterSeries::borderColorChanged(QColor color)
89 \brief Signal is emitted when the line (pen) color has changed to \a color.
78 */
90 */
79
91
80 /*!
92 /*!
@@ -108,47 +120,64 QAbstractSeries::SeriesType QScatterSeries::type() const
108 return QAbstractSeries::SeriesTypeScatter;
120 return QAbstractSeries::SeriesTypeScatter;
109 }
121 }
110
122
111 /*!
123 void QScatterSeries::setColor(const QColor &color)
112 Returns the shape used for drawing markers.
124 {
113 */
125 QBrush b = brush();
126 if (b.color() != color) {
127 b.setColor(color);
128 setBrush(b);
129 emit colorChanged(color);
130 }
131 }
132
133 QColor QScatterSeries::color() const
134 {
135 return brush().color();
136 }
137
138 void QScatterSeries::setBorderColor(const QColor &color)
139 {
140 QPen p = pen();
141 if (p.color() != color) {
142 p.setColor(color);
143 setPen(p);
144 emit borderColorChanged(color);
145 }
146 }
147
148 QColor QScatterSeries::borderColor() const
149 {
150 return pen().color();
151 }
152
114 QScatterSeries::MarkerShape QScatterSeries::markerShape() const
153 QScatterSeries::MarkerShape QScatterSeries::markerShape() const
115 {
154 {
116 Q_D(const QScatterSeries);
155 Q_D(const QScatterSeries);
117 return d->m_shape;
156 return d->m_shape;
118 }
157 }
119
158
120 /*!
121 Overrides the default shape of the marker items with a user defined \a shape. The default shape
122 is defined by chart theme setting.
123 */
124 void QScatterSeries::setMarkerShape(MarkerShape shape)
159 void QScatterSeries::setMarkerShape(MarkerShape shape)
125 {
160 {
126 Q_D(QScatterSeries);
161 Q_D(QScatterSeries);
127 if (d->m_shape != shape) {
162 if (d->m_shape != shape) {
128 d->m_shape = shape;
163 d->m_shape = shape;
129 emit markerShapeChanged();
164 emit d->updated();
130 }
165 }
131 }
166 }
132
167
133 /*!
134 Returns the size of the marker items.
135 */
136 qreal QScatterSeries::markerSize() const
168 qreal QScatterSeries::markerSize() const
137 {
169 {
138 Q_D(const QScatterSeries);
170 Q_D(const QScatterSeries);
139 return d->m_size;
171 return d->m_size;
140 }
172 }
141
173
142 /*!
143 Set the \a size of the marker items. The default size is 15.
144 */
145 void QScatterSeries::setMarkerSize(qreal size)
174 void QScatterSeries::setMarkerSize(qreal size)
146 {
175 {
147 Q_D(QScatterSeries);
176 Q_D(QScatterSeries);
148
177
149 if (!qFuzzyIsNull(d->m_size - size)) {
178 if (!qFuzzyIsNull(d->m_size - size)) {
150 d->m_size = size;
179 d->m_size = size;
151 emit markerSizeChanged();
180 emit d->updated();
152 }
181 }
153 }
182 }
154
183
@@ -31,8 +31,10 class QScatterSeriesPrivate;
31 class QTCOMMERCIALCHART_EXPORT QScatterSeries : public QXYSeries
31 class QTCOMMERCIALCHART_EXPORT QScatterSeries : public QXYSeries
32 {
32 {
33 Q_OBJECT
33 Q_OBJECT
34 Q_PROPERTY(MarkerShape markerShape READ markerShape WRITE setMarkerShape NOTIFY markerShapeChanged)
34 Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged)
35 Q_PROPERTY(qreal markerSize READ markerSize WRITE setMarkerSize NOTIFY markerSizeChanged)
35 Q_PROPERTY(QColor borderColor READ borderColor WRITE setBorderColor NOTIFY borderColorChanged)
36 Q_PROPERTY(MarkerShape markerShape READ markerShape WRITE setMarkerShape)
37 Q_PROPERTY(qreal markerSize READ markerSize WRITE setMarkerSize)
36 Q_ENUMS(MarkerShape)
38 Q_ENUMS(MarkerShape)
37
39
38 public:
40 public:
@@ -45,20 +47,23 public:
45 explicit QScatterSeries(QObject *parent = 0);
47 explicit QScatterSeries(QObject *parent = 0);
46 ~QScatterSeries();
48 ~QScatterSeries();
47 QAbstractSeries::SeriesType type() const;
49 QAbstractSeries::SeriesType type() const;
50 void setColor(const QColor &color);
51 QColor color() const;
52 void setBorderColor(const QColor &color);
53 QColor borderColor() const;
48 MarkerShape markerShape() const;
54 MarkerShape markerShape() const;
49 void setMarkerShape(MarkerShape shape);
55 void setMarkerShape(MarkerShape shape);
50 qreal markerSize() const;
56 qreal markerSize() const;
51 void setMarkerSize(qreal size);
57 void setMarkerSize(qreal size);
52
58
53 Q_SIGNALS:
59 Q_SIGNALS:
54 void markerShapeChanged();
60 void colorChanged(QColor color);
55 void markerSizeChanged();
61 void borderColorChanged(QColor color);
56
62
57 private:
63 private:
58 Q_DECLARE_PRIVATE(QScatterSeries)
64 Q_DECLARE_PRIVATE(QScatterSeries)
59 Q_DISABLE_COPY(QScatterSeries)
65 Q_DISABLE_COPY(QScatterSeries)
60 friend class ScatterChartItem;
66 friend class ScatterChartItem;
61
62 };
67 };
63
68
64 QTCOMMERCIALCHART_END_NAMESPACE
69 QTCOMMERCIALCHART_END_NAMESPACE
@@ -39,8 +39,6 ScatterChartItem::ScatterChartItem(QScatterSeries *series, ChartPresenter *prese
39 m_size(15)
39 m_size(15)
40 {
40 {
41 QObject::connect(m_series->d_func(),SIGNAL(updated()), this, SLOT(handleUpdated()));
41 QObject::connect(m_series->d_func(),SIGNAL(updated()), this, SLOT(handleUpdated()));
42 QObject::connect(m_series, SIGNAL(markerShapeChanged()), this, SLOT(handleUpdated()));
43 QObject::connect(m_series, SIGNAL(markerSizeChanged()), this, SLOT(handleUpdated()));
44 QObject::connect(m_series, SIGNAL(visibleChanged()), this, SLOT(handleUpdated()));
42 QObject::connect(m_series, SIGNAL(visibleChanged()), this, SLOT(handleUpdated()));
45
43
46 setZValue(ChartPresenter::ScatterSeriesZValue);
44 setZValue(ChartPresenter::ScatterSeriesZValue);
@@ -49,6 +49,12 QTCOMMERCIALCHART_BEGIN_NAMESPACE
49 */
49 */
50
50
51 /*!
51 /*!
52 \property QXYSeries::color
53 Line (pen) color of the series. This is a convenience property for modifying the color of pen.
54 \sa QXYSeries::pen()
55 */
56
57 /*!
52 \fn void QXYSeries::clicked(const QPointF& point)
58 \fn void QXYSeries::clicked(const QPointF& point)
53 \brief Signal is emitted when user clicks the \a point on chart.
59 \brief Signal is emitted when user clicks the \a point on chart.
54 */
60 */
@@ -72,8 +78,8 QTCOMMERCIALCHART_BEGIN_NAMESPACE
72 */
78 */
73
79
74 /*!
80 /*!
75 \fn void QXYSeries::pointsVisibleChanged(bool visible)
81 \fn void QXYSeries::colorChanged(QColor color)
76 \brief Signal is emitted when the point visibility has changed to \a visible.
82 \brief Signal is emitted when the line (pen) color has changed to \a color.
77 */
83 */
78
84
79 /*!
85 /*!
@@ -254,6 +260,20 QBrush QXYSeries::brush() const
254 return d->m_brush;
260 return d->m_brush;
255 }
261 }
256
262
263 void QXYSeries::setColor(const QColor &color)
264 {
265 QPen p = pen();
266 if (p.color() != color) {
267 p.setColor(color);
268 setPen(p);
269 emit colorChanged(color);
270 }
271 }
272
273 QColor QXYSeries::color() const
274 {
275 return pen().color();
276 }
257
277
258 void QXYSeries::setPointsVisible(bool visible)
278 void QXYSeries::setPointsVisible(bool visible)
259 {
279 {
@@ -261,7 +281,6 void QXYSeries::setPointsVisible(bool visible)
261 if (d->m_pointsVisible != visible){
281 if (d->m_pointsVisible != visible){
262 d->m_pointsVisible = visible;
282 d->m_pointsVisible = visible;
263 emit d->updated();
283 emit d->updated();
264 emit pointsVisibleChanged(visible);
265 }
284 }
266 }
285 }
267
286
@@ -36,7 +36,8 class QXYModelMapper;
36 class QTCOMMERCIALCHART_EXPORT QXYSeries : public QAbstractSeries
36 class QTCOMMERCIALCHART_EXPORT QXYSeries : public QAbstractSeries
37 {
37 {
38 Q_OBJECT
38 Q_OBJECT
39 Q_PROPERTY(bool pointsVisible READ pointsVisible WRITE setPointsVisible NOTIFY pointsVisibleChanged)
39 Q_PROPERTY(bool pointsVisible READ pointsVisible WRITE setPointsVisible)
40 Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged)
40
41
41 protected:
42 protected:
42 explicit QXYSeries(QXYSeriesPrivate &d,QObject *parent = 0);
43 explicit QXYSeries(QXYSeriesPrivate &d,QObject *parent = 0);
@@ -65,6 +66,9 public:
65 void setBrush(const QBrush &brush);
66 void setBrush(const QBrush &brush);
66 QBrush brush() const;
67 QBrush brush() const;
67
68
69 virtual void setColor(const QColor &color);
70 virtual QColor color() const;
71
68 void setPointsVisible(bool visible = true);
72 void setPointsVisible(bool visible = true);
69 bool pointsVisible() const;
73 bool pointsVisible() const;
70
74
@@ -73,8 +77,7 Q_SIGNALS:
73 void pointReplaced(int index);
77 void pointReplaced(int index);
74 void pointRemoved(int index);
78 void pointRemoved(int index);
75 void pointAdded(int index);
79 void pointAdded(int index);
76 void pointsVisibleChanged(bool visible);
80 void colorChanged(QColor color);
77
78
81
79 private:
82 private:
80 Q_DECLARE_PRIVATE(QXYSeries)
83 Q_DECLARE_PRIVATE(QXYSeries)
@@ -29,12 +29,16 Flow {
29 property variant series
29 property variant series
30
30
31 onSeriesChanged: {
31 onSeriesChanged: {
32 if (series && series.name == "area 1") {
32 seriesConnections.target = series;
33 seriesConnections.target = series;
34 } else {
35 seriesConnections.target = null;
36 }
33 }
37 }
34
38
35 Connections {
39 Connections {
36 id: seriesConnections
40 id: seriesConnections
37 ignoreUnknownSignals: true
41 target: null
38 onNameChanged: console.log("series.onNameChanged: " + series.name);
42 onNameChanged: console.log("series.onNameChanged: " + series.name);
39 onVisibleChanged: console.log("series.onVisibleChanged: " + series.visible);
43 onVisibleChanged: console.log("series.onVisibleChanged: " + series.visible);
40 onColorChanged: console.log("series.onColorChanged: " + series.color);
44 onColorChanged: console.log("series.onColorChanged: " + series.color);
@@ -32,6 +32,7 ChartView {
32
32
33 BarSeries {
33 BarSeries {
34 id: daSeries
34 id: daSeries
35 name: "bar"
35 BarSet { label: "Bob"; values: [4, 7, 3, 10, 5, 6] }
36 BarSet { label: "Bob"; values: [4, 7, 3, 10, 5, 6] }
36 BarSet { label: "Susan"; values: [5, 1, 2, 4, 1, 8] }
37 BarSet { label: "Susan"; values: [5, 1, 2, 4, 1, 8] }
37 BarSet { label: "James"; values: [3, 5, 8, 5, 4, 7] }
38 BarSet { label: "James"; values: [3, 5, 8, 5, 4, 7] }
@@ -28,13 +28,18 Flow {
28 property variant series
28 property variant series
29
29
30 onSeriesChanged: {
30 onSeriesChanged: {
31 if (series && series.name == "bar") {
31 seriesConnections.target = series;
32 seriesConnections.target = series;
32 setConnections.target = series.at(0);
33 setConnections.target = series.at(0);
34 } else {
35 seriesConnections.target = null;
36 setConnections.target = null;
37 }
33 }
38 }
34
39
35 Connections {
40 Connections {
36 id: seriesConnections
41 id: seriesConnections
37 ignoreUnknownSignals: true
42 target: null
38 onNameChanged: console.log("series.onNameChanged: " + series.name);
43 onNameChanged: console.log("series.onNameChanged: " + series.name);
39 onVisibleChanged: console.log("series.onVisibleChanged: " + series.visible);
44 onVisibleChanged: console.log("series.onVisibleChanged: " + series.visible);
40 onBarWidthChanged: console.log("series.onBardWidthChanged: " + width)
45 onBarWidthChanged: console.log("series.onBardWidthChanged: " + width)
@@ -44,7 +49,7 Flow {
44
49
45 Connections {
50 Connections {
46 id: setConnections
51 id: setConnections
47 ignoreUnknownSignals: true
52 target: null
48 onColorChanged: console.log("series.onColorChanged: " + color);
53 onColorChanged: console.log("series.onColorChanged: " + color);
49 onBorderColorChanged: console.log("series.onBorderColorChanged: " + color);
54 onBorderColorChanged: console.log("series.onBorderColorChanged: " + color);
50 onLabelColorChanged: console.log("series.onLabelColorChanged: " + color);
55 onLabelColorChanged: console.log("series.onLabelColorChanged: " + color);
@@ -29,18 +29,22 Flow {
29 property variant series // TODO: rename to chart
29 property variant series // TODO: rename to chart
30
30
31 onSeriesChanged: {
31 onSeriesChanged: {
32 if (series && series.name == "") {
33 chartConnections.target = series;
32 legendConnections.target = series.legend;
34 legendConnections.target = series.legend;
33 axisXConnections.target = series.axisX;
35 axisXConnections.target = series.axisX;
34 axisYConnections.target = series.axisY;
36 axisYConnections.target = series.axisY;
37 } else {
38 legendConnections.target = null;
39 axisXConnections.target = null;
40 axisYConnections.target = null;
41 }
35 }
42 }
36
43
37 Connections {
44 Connections {
38 target: series
45 id: chartConnections
39 ignoreUnknownSignals: true
46 target: null
40 onVisibleChanged: console.log("chart.onVisibleChanged: " + series.visible);
47 onVisibleChanged: console.log("chart.onVisibleChanged: " + series.visible);
41 onThemeChanged: console.log("chart.onThemeChanged: " + series.theme);
42 onLegendChanged: console.log("chart.onLegendChanged: " + series.legend);
43 onAnimationOptionsChanged: console.log("chart.onAnimationOptionsChanged: " + series.animationOptions);
44 onTitleColorChanged: console.log("chart.onTitleColorChanged: " + series.titleColor);
48 onTitleColorChanged: console.log("chart.onTitleColorChanged: " + series.titleColor);
45 onBackgroundColorChanged: console.log("chart.onBackgroundColorChanged: " + series.backgroundColor);
49 onBackgroundColorChanged: console.log("chart.onBackgroundColorChanged: " + series.backgroundColor);
46 onDropShadowEnabledChanged: console.log("chart.onDropShadowEnabledChanged: " + enabled);
50 onDropShadowEnabledChanged: console.log("chart.onDropShadowEnabledChanged: " + enabled);
@@ -48,8 +52,7 Flow {
48
52
49 Connections {
53 Connections {
50 id: legendConnections
54 id: legendConnections
51 ignoreUnknownSignals: true
55 target: null
52 onAlignmentChanged: console.log("legend.onAlignmentChanged: " + alignment);
53 onVisibleChanged: console.log("legend.onVisibleChanged: " + series.legend.visible);
56 onVisibleChanged: console.log("legend.onVisibleChanged: " + series.legend.visible);
54 onBackgroundVisibleChanged: console.log("legend.onBackgroundVisibleChanged: " + visible);
57 onBackgroundVisibleChanged: console.log("legend.onBackgroundVisibleChanged: " + visible);
55 onColorChanged: console.log("legend.onColorChanged: " + color);
58 onColorChanged: console.log("legend.onColorChanged: " + color);
@@ -58,11 +61,10 Flow {
58
61
59 Connections {
62 Connections {
60 id: axisXConnections
63 id: axisXConnections
61 ignoreUnknownSignals: true
64 target: null
62 onColorChanged: console.log("axisX.onColorChanged: " + color);
65 onColorChanged: console.log("axisX.onColorChanged: " + color);
63 onLabelsVisibleChanged: console.log("axisX.onLabelsVisibleChanged: " + visible);
66 onLabelsVisibleChanged: console.log("axisX.onLabelsVisibleChanged: " + visible);
64 onLabelsColorChanged: console.log("axisX.onLabelsColorChanged: " + color);
67 onLabelsColorChanged: console.log("axisX.onLabelsColorChanged: " + color);
65 onLabelsAngleChanged: console.log("axisX.onLabelsAngleChanged: " + angle);
66 onVisibleChanged: console.log("axisX.onVisibleChanged: " + visible);
68 onVisibleChanged: console.log("axisX.onVisibleChanged: " + visible);
67 onGridVisibleChanged: console.log("axisX.onGridVisibleChanged: " + visible);
69 onGridVisibleChanged: console.log("axisX.onGridVisibleChanged: " + visible);
68 onShadesVisibleChanged: console.log("axisX.onShadesVisibleChanged: " + visible);
70 onShadesVisibleChanged: console.log("axisX.onShadesVisibleChanged: " + visible);
@@ -70,17 +72,14 Flow {
70 onShadesBorderColorChanged: console.log("axisX.onShadesBorderColorChanged: " + color);
72 onShadesBorderColorChanged: console.log("axisX.onShadesBorderColorChanged: " + color);
71 onMinChanged: console.log("axisX.onMinChanged: " + min);
73 onMinChanged: console.log("axisX.onMinChanged: " + min);
72 onMaxChanged: console.log("axisX.onMaxChanged: " + max);
74 onMaxChanged: console.log("axisX.onMaxChanged: " + max);
73 onTicksCountChanged: console.log("axisX.onTicksCountChanged: " + count);
74 onNiceNumbersEnabledChanged: console.log("axisX.onNiceNumbersEnabledChanged: " + enabled);
75 }
75 }
76
76
77 Connections {
77 Connections {
78 id: axisYConnections
78 id: axisYConnections
79 ignoreUnknownSignals: true
79 target: null
80 onColorChanged: console.log("axisY.onColorChanged: " + color);
80 onColorChanged: console.log("axisY.onColorChanged: " + color);
81 onLabelsVisibleChanged: console.log("axisY.onLabelsVisibleChanged: " + visible);
81 onLabelsVisibleChanged: console.log("axisY.onLabelsVisibleChanged: " + visible);
82 onLabelsColorChanged: console.log("axisY.onLabelsColorChanged: " + color);
82 onLabelsColorChanged: console.log("axisY.onLabelsColorChanged: " + color);
83 onLabelsAngleChanged: console.log("axisY.onLabelsAngleChanged: " + angle);
84 onVisibleChanged: console.log("axisY.onVisibleChanged: " + visible);
83 onVisibleChanged: console.log("axisY.onVisibleChanged: " + visible);
85 onGridVisibleChanged: console.log("axisY.onGridVisibleChanged: " + visible);
84 onGridVisibleChanged: console.log("axisY.onGridVisibleChanged: " + visible);
86 onShadesVisibleChanged: console.log("axisY.onShadesVisibleChanged: " + visible);
85 onShadesVisibleChanged: console.log("axisY.onShadesVisibleChanged: " + visible);
@@ -88,8 +87,6 Flow {
88 onShadesBorderColorChanged: console.log("axisY.onShadesBorderColorChanged: " + color);
87 onShadesBorderColorChanged: console.log("axisY.onShadesBorderColorChanged: " + color);
89 onMinChanged: console.log("axisY.onMinChanged: " + min);
88 onMinChanged: console.log("axisY.onMinChanged: " + min);
90 onMaxChanged: console.log("axisY.onMaxChanged: " + max);
89 onMaxChanged: console.log("axisY.onMaxChanged: " + max);
91 onTicksCountChanged: console.log("axisY.onTicksCountChanged: " + count);
92 onNiceNumbersEnabledChanged: console.log("axisY.onNiceNumbersEnabledChanged: " + enabled);
93 }
90 }
94
91
95 Button {
92 Button {
@@ -32,6 +32,7 ChartView {
32
32
33 GroupedBarSeries {
33 GroupedBarSeries {
34 id: daSeries
34 id: daSeries
35 name: "bar"
35 BarSet { label: "Bob"; values: [2, 2, 3, 4, 5, 6] }
36 BarSet { label: "Bob"; values: [2, 2, 3, 4, 5, 6] }
36 BarSet { label: "Susan"; values: [5, 1, 2, 4, 1, 7] }
37 BarSet { label: "Susan"; values: [5, 1, 2, 4, 1, 7] }
37 BarSet { label: "James"; values: [3, 5, 8, 13, 5, 8] }
38 BarSet { label: "James"; values: [3, 5, 8, 13, 5, 8] }
@@ -29,15 +29,18 Flow {
29 property variant series
29 property variant series
30
30
31 onSeriesChanged: {
31 onSeriesChanged: {
32 if (series && (series.name == "line 1" || series.name == "spline 1")) {
32 seriesConnections.target = series;
33 seriesConnections.target = series;
34 } else {
35 seriesConnections.target = null;
36 }
33 }
37 }
34
38
35 Connections {
39 Connections {
36 id: seriesConnections
40 id: seriesConnections
37 ignoreUnknownSignals: true
41 target: null
38 onNameChanged: console.log("series.onNameChanged: " + series.name);
42 onNameChanged: console.log("series.onNameChanged: " + series.name);
39 onVisibleChanged: console.log("series.onVisibleChanged: " + series.visible);
43 onVisibleChanged: console.log("series.onVisibleChanged: " + series.visible);
40 onPointsVisibleChanged: console.log("series.onPointsVisibleChanged: " + series.pointsVisible);
41 onColorChanged: console.log("series.onColorChanged: " + series.color);
44 onColorChanged: console.log("series.onColorChanged: " + series.color);
42 onCountChanged: console.log("series.onCountChanged: " + series.count);
45 onCountChanged: console.log("series.onCountChanged: " + series.count);
43 }
46 }
@@ -32,6 +32,7 ChartView {
32
32
33 PercentBarSeries {
33 PercentBarSeries {
34 id: daSeries
34 id: daSeries
35 name: "bar"
35 BarSet { label: "Bob"; values: [2, 2, 3, 4, 5, 6] }
36 BarSet { label: "Bob"; values: [2, 2, 3, 4, 5, 6] }
36 BarSet { label: "Susan"; values: [5, 1, 2, 4, 1, 7] }
37 BarSet { label: "Susan"; values: [5, 1, 2, 4, 1, 7] }
37 BarSet { label: "James"; values: [3, 5, 8, 13, 5, 8] }
38 BarSet { label: "James"; values: [3, 5, 8, 13, 5, 8] }
@@ -30,6 +30,7 ChartView {
30
30
31 PieSeries {
31 PieSeries {
32 id: pieSeries
32 id: pieSeries
33 name: "pie"
33 PieSlice { id: daSlice; label: "slice1"; value: 11 }
34 PieSlice { id: daSlice; label: "slice1"; value: 11 }
34 PieSlice { label: "slice2"; value: 22 }
35 PieSlice { label: "slice2"; value: 22 }
35 PieSlice { label: "slice3"; value: 33 }
36 PieSlice { label: "slice3"; value: 33 }
@@ -28,13 +28,18 Flow {
28 property variant series
28 property variant series
29
29
30 onSeriesChanged: {
30 onSeriesChanged: {
31 if (series && series.name == "pie") {
31 seriesConnections.target = series;
32 seriesConnections.target = series;
32 sliceConnections.target = series.at(0);
33 sliceConnections.target = series.at(0);
34 } else {
35 seriesConnections.target = null;
36 sliceConnections.target = null;
37 }
33 }
38 }
34
39
35 Connections {
40 Connections {
36 id: seriesConnections
41 id: seriesConnections
37 ignoreUnknownSignals: true
42 target: null
38 onVisibleChanged: console.log("series.onVisibleChanged: " + series.visible);
43 onVisibleChanged: console.log("series.onVisibleChanged: " + series.visible);
39 onHorizontalPositionChanged:console.log("series.onHorizontalPositionChanged: " + series.horizontalPosition);
44 onHorizontalPositionChanged:console.log("series.onHorizontalPositionChanged: " + series.horizontalPosition);
40 onVerticalPositionChanged: console.log("series.onVerticalPositionChanged: " + series.verticalPosition);
45 onVerticalPositionChanged: console.log("series.onVerticalPositionChanged: " + series.verticalPosition);
@@ -47,7 +52,7 Flow {
47
52
48 Connections {
53 Connections {
49 id: sliceConnections
54 id: sliceConnections
50 ignoreUnknownSignals: true
55 target: null
51 onValueChanged: console.log("slice.onValueChanged: " + series.at(0).value);
56 onValueChanged: console.log("slice.onValueChanged: " + series.at(0).value);
52 onLabelVisibleChanged: console.log("slice.onLabelVisibleChanged: " + series.at(0).labelVisible);
57 onLabelVisibleChanged: console.log("slice.onLabelVisibleChanged: " + series.at(0).labelVisible);
53 onLabelPositionChanged: console.log("slice.onLabelPositionChanged: " + series.at(0).labelPosition);
58 onLabelPositionChanged: console.log("slice.onLabelPositionChanged: " + series.at(0).labelPosition);
@@ -29,20 +29,21 Flow {
29 property variant series
29 property variant series
30
30
31 onSeriesChanged: {
31 onSeriesChanged: {
32 if (series && series.name == "scatter 1") {
32 seriesConnections.target = series;
33 seriesConnections.target = series;
34 } else {
35 seriesConnections.target = null;
36 }
33 }
37 }
34
38
35 Connections {
39 Connections {
36 id: seriesConnections
40 id: seriesConnections
37 ignoreUnknownSignals: true
41 target: null
38 onNameChanged: console.log("series.onNameChanged: " + series.name);
42 onNameChanged: console.log("series.onNameChanged: " + series.name);
39 onVisibleChanged: console.log("series.onVisibleChanged: " + series.visible);
43 onVisibleChanged: console.log("series.onVisibleChanged: " + series.visible);
40 onPointsVisibleChanged: console.log("series.onPointsVisibleChanged: " + series.pointsVisible);
41 onColorChanged: console.log("series.onColorChanged: " + series.color);
44 onColorChanged: console.log("series.onColorChanged: " + series.color);
42 onBorderColorChanged: console.log("series.onBorderColorChanged: " + series.borderColor);
45 onBorderColorChanged: console.log("series.onBorderColorChanged: " + series.borderColor);
43 onCountChanged: console.log("series.onCountChanged: " + series.count);
46 onCountChanged: console.log("series.onCountChanged: " + series.count);
44 onMarkerSizeChanged: console.log("series.onMarkerSizeChanged: " + series.markerSize);
45 onMarkerShapeChanged: console.log("series.onMarkerShapeChanged: " + series.markerShape);
46 }
47 }
47
48
48 Button {
49 Button {
@@ -32,6 +32,7 ChartView {
32
32
33 StackedBarSeries {
33 StackedBarSeries {
34 id: daSeries
34 id: daSeries
35 name: "bar"
35 BarSet { label: "Bob"; values: [2, 2, 3, 4, 5, 6] }
36 BarSet { label: "Bob"; values: [2, 2, 3, 4, 5, 6] }
36 BarSet { label: "Susan"; values: [5, 1, 2, 4, 1, 7] }
37 BarSet { label: "Susan"; values: [5, 1, 2, 4, 1, 7] }
37 BarSet { label: "James"; values: [3, 5, 8, 13, 5, 8] }
38 BarSet { label: "James"; values: [3, 5, 8, 13, 5, 8] }
General Comments 0
You need to be logged in to leave comments. Login now