##// END OF EJS Templates
Default marker size to 15 for scatter
Tero Ahola -
r702:9b39a28ee6a8
parent child
Show More
@@ -1,98 +1,98
1 #include "qscatterseries.h"
1 #include "qscatterseries.h"
2 #include "qchart.h"
2 #include "qchart.h"
3
3
4 /*!
4 /*!
5 \class QScatterSeries
5 \class QScatterSeries
6 \brief The QScatterSeries class is used for making scatter charts.
6 \brief The QScatterSeries class is used for making scatter charts.
7
7
8 \mainclass
8 \mainclass
9
9
10 The scatter data is displayed as a collection of points on the chart. Each point determines the position on the horizontal axis
10 The scatter data is displayed as a collection of points on the chart. Each point determines the position on the horizontal axis
11 and the vertical axis.
11 and the vertical axis.
12
12
13 \image scatterchart.png
13 \image scatterchart.png
14
14
15 Creating basic scatter chart is simple:
15 Creating basic scatter chart is simple:
16 \code
16 \code
17 QScatterSeries* series = new QScatterSeries();
17 QScatterSeries* series = new QScatterSeries();
18 series->add(0, 6);
18 series->add(0, 6);
19 series->add(2, 4);
19 series->add(2, 4);
20 ...
20 ...
21 chartView->addSeries(series);
21 chartView->addSeries(series);
22 \endcode
22 \endcode
23 */
23 */
24
24
25 /*!
25 /*!
26 \enum QScatterSeries::MarkerShape
26 \enum QScatterSeries::MarkerShape
27
27
28 This enum describes the shape used when rendering marker items.
28 This enum describes the shape used when rendering marker items.
29
29
30 \value MarkerShapeCircle
30 \value MarkerShapeCircle
31 \value MarkerShapeRectangle
31 \value MarkerShapeRectangle
32 */
32 */
33
33
34 /*!
34 /*!
35 \fn QChartSeriesType QScatterSeries::type() const
35 \fn QChartSeriesType QScatterSeries::type() const
36 \brief Returns QChartSeries::SeriesTypeScatter.
36 \brief Returns QChartSeries::SeriesTypeScatter.
37 \sa QSeries, QSeriesType
37 \sa QSeries, QSeriesType
38 */
38 */
39
39
40 QTCOMMERCIALCHART_BEGIN_NAMESPACE
40 QTCOMMERCIALCHART_BEGIN_NAMESPACE
41
41
42 /*!
42 /*!
43 Constructs a series object which is a child of \a parent.
43 Constructs a series object which is a child of \a parent.
44 */
44 */
45 QScatterSeries::QScatterSeries(QObject *parent) :
45 QScatterSeries::QScatterSeries(QObject *parent) :
46 QXYSeries(parent),
46 QXYSeries(parent),
47 m_shape(QScatterSeries::MarkerShapeCircle),
47 m_shape(QScatterSeries::MarkerShapeCircle),
48 m_size(9.0)
48 m_size(15.0)
49 {
49 {
50 }
50 }
51
51
52 /*!
52 /*!
53 Destroys the object. Note that adding series to QChart transfers the ownership to the chart.
53 Destroys the object. Note that adding series to QChart transfers the ownership to the chart.
54 */
54 */
55 QScatterSeries::~QScatterSeries()
55 QScatterSeries::~QScatterSeries()
56 {
56 {
57 }
57 }
58
58
59 /*!
59 /*!
60 Returns the shape used for drawing markers.
60 Returns the shape used for drawing markers.
61 */
61 */
62 QScatterSeries::MarkerShape QScatterSeries::shape() const
62 QScatterSeries::MarkerShape QScatterSeries::shape() const
63 {
63 {
64 return m_shape;
64 return m_shape;
65 }
65 }
66
66
67 /*!
67 /*!
68 Overrides the default shape of the marker items with a user defined \a shape. The default shape
68 Overrides the default shape of the marker items with a user defined \a shape. The default shape
69 is defined by chart theme setting.
69 is defined by chart theme setting.
70 */
70 */
71 void QScatterSeries::setShape(MarkerShape shape)
71 void QScatterSeries::setShape(MarkerShape shape)
72 {
72 {
73 if(m_shape!= shape){
73 if(m_shape!= shape){
74 m_shape=shape;
74 m_shape=shape;
75 emit QXYSeries::updated();
75 emit QXYSeries::updated();
76 }
76 }
77 }
77 }
78
78
79 /*!
79 /*!
80 Returns the size of the marker items.
80 Returns the size of the marker items.
81 */
81 */
82 qreal QScatterSeries::size() const
82 qreal QScatterSeries::size() const
83 {
83 {
84 return m_size;
84 return m_size;
85 }
85 }
86
86
87 /*!
87 /*!
88 Set the \a size of the marker items. The default size is 9.0.
88 Set the \a size of the marker items. The default size is 9.0.
89 */
89 */
90 void QScatterSeries::setSize(qreal size)
90 void QScatterSeries::setSize(qreal size)
91 {
91 {
92 if(m_size != size){
92 if(m_size != size){
93 m_size=size;
93 m_size=size;
94 emit updated();
94 emit updated();
95 }
95 }
96 }
96 }
97
97
98 QTCOMMERCIALCHART_END_NAMESPACE
98 QTCOMMERCIALCHART_END_NAMESPACE
General Comments 0
You need to be logged in to leave comments. Login now