##// END OF EJS Templates
Docs updated
Marek Rosa -
r908:803e57309061
parent child
Show More
@@ -11,19 +11,19
11
11
12 \snippet ../examples/splinechart/main.cpp 1
12 \snippet ../examples/splinechart/main.cpp 1
13
13
14 Now lets add some data points to the series.
14 Now let's add some data points to the series.
15
15
16 \snippet ../examples/splinechart/main.cpp 3
16 \snippet ../examples/splinechart/main.cpp 2
17
17
18 The data series has been populated. To display it on a chart we create QChart object and add the data series to it. We also set the title and the values range on y axis, so that our chart is better visible.
18 The data series has been populated. To display it on a chart we create QChart object and add the data series to it. We also set the title and the values range on y axis, so that our chart is better visible.
19
19
20 \snippet ../examples/splinechart/main.cpp 4
20 \snippet ../examples/splinechart/main.cpp 3
21
21
22 Then we create a QChartView object with QChart as a parameter. This way we don't need to create QGraphicsView scene ourselves. We also set the Antialiasing on to have the rendered lines look nicer.
22 Then we create a QChartView object with QChart as a parameter. This way we don't need to create QGraphicsView scene ourselves. We also set the Antialiasing on to have the rendered lines look nicer.
23
23
24 \snippet ../examples/splinechart/main.cpp 5
24 \snippet ../examples/splinechart/main.cpp 4
25
25
26 In the end we set the QChartView as the windows's central widget.
26 In the end we set the QChartView as the windows's central widget.
27
27
28 \snippet ../examples/splinechart/main.cpp 6
28 \snippet ../examples/splinechart/main.cpp 5
29 */
29 */
@@ -34,38 +34,32 int main(int argc, char *argv[])
34 //![1]
34 //![1]
35
35
36 //![2]
36 //![2]
37 // QPen red(Qt::red);
38 // red.setWidth(3);
39 // series->setPen(red);
40 //![2]
41
42 //![3]
43 series->append(0, 6);
37 series->append(0, 6);
44 series->append(2, 4);
38 series->append(2, 4);
45 series->append(3, 8);
39 series->append(3, 8);
46 series->append(7, 4);
40 series->append(7, 4);
47 series->append(10, 5);
41 series->append(10, 5);
48 *series << QPointF(11, 1) << QPointF(13, 3) << QPointF(17, 6) << QPointF(18, 3) << QPointF(20, 2);
42 *series << QPointF(11, 1) << QPointF(13, 3) << QPointF(17, 6) << QPointF(18, 3) << QPointF(20, 2);
49 //![3]
43 //![2]
50
44
51 //![4]
45 //![3]
52 QChart* chart = new QChart();
46 QChart* chart = new QChart();
53 chart->addSeries(series);
47 chart->addSeries(series);
54 chart->setTitle("Simple spline chart example");
48 chart->setTitle("Simple spline chart example");
55 chart->axisY()->setRange(0, 10);
49 chart->axisY()->setRange(0, 10);
56 //![4]
50 //![3]
57
51
58 //![5]
52 //![4]
59 QChartView* chartView = new QChartView(chart);
53 QChartView* chartView = new QChartView(chart);
60 chartView->setRenderHint(QPainter::Antialiasing);
54 chartView->setRenderHint(QPainter::Antialiasing);
61 //![5]
55 //![4]
62
56
63 //![6]
57 //![5]
64 QMainWindow window;
58 QMainWindow window;
65 window.setCentralWidget(chartView);
59 window.setCentralWidget(chartView);
66 window.resize(400, 300);
60 window.resize(400, 300);
67 window.show();
61 window.show();
68 //![6]
62 //![5]
69
63
70 return a.exec();
64 return a.exec();
71 }
65 }
@@ -56,11 +56,6 QTCOMMERCIALCHART_BEGIN_NAMESPACE
56 */
56 */
57
57
58 /*!
58 /*!
59 \fn void QBarSet::setLabelssVisible(bool visible = true)
60 \brief Sets visibility of bar labels. If \a visible is true, labels are drawn on top of barsets.
61 */
62
63 /*!
64 \fn void QBarSet::showToolTip(QPoint pos, QString tip)
59 \fn void QBarSet::showToolTip(QPoint pos, QString tip)
65 \brief \internal \a pos \a tip
60 \brief \internal \a pos \a tip
66 */
61 */
@@ -244,8 +239,9 QFont QBarSet::labelFont() const
244 }
239 }
245
240
246 /*!
241 /*!
247 Sets the visibility of barset values to \a visible
242 Sets visibility of bar labels. If \a visible is true, labels are drawn on top of barsets.
248 */
243 */
244
249 void QBarSet::setLabelsVisible(bool visible)
245 void QBarSet::setLabelsVisible(bool visible)
250 {
246 {
251 m_labelsVisible = visible;
247 m_labelsVisible = visible;
@@ -68,6 +68,11
68 */
68 */
69
69
70 /*!
70 /*!
71 \property QString QSeries::name
72 \brief name of the series property
73 */
74
75 /*!
71 \fn void QSeries::setName(QString name)
76 \fn void QSeries::setName(QString name)
72 \brief Sets a \a name for the series.
77 \brief Sets a \a name for the series.
73
78
@@ -78,8 +83,9
78 */
83 */
79
84
80 /*!
85 /*!
81 \fn QString QSeries::name()
86 \fn QString QSeries::name() const
82 \brief Returns the name of the series.
87 \brief Returns the name of the series.
88 \sa setName()
83 */
89 */
84
90
85 QTCOMMERCIALCHART_USE_NAMESPACE
91 QTCOMMERCIALCHART_USE_NAMESPACE
@@ -155,7 +155,7 void QSplineSeries::updateControlPoints()
155 }
155 }
156 }
156 }
157
157
158 /*!
158 /*//!
159 \fn bool QSplineSeries::setModel(QAbstractItemModel *model)
159 \fn bool QSplineSeries::setModel(QAbstractItemModel *model)
160 Sets the \a model to be used as a data source
160 Sets the \a model to be used as a data source
161 \sa setModelMapping(), setModelMappingRange()
161 \sa setModelMapping(), setModelMappingRange()
@@ -167,8 +167,8 void QSplineSeries::updateControlPoints()
167 // return true;
167 // return true;
168 //}
168 //}
169
169
170 /*!
170 /*//!
171 \fn bool QXYSeries::setModelMapping(int modelX, int modelY, Qt::Orientation orientation)
171 \fn bool QSplineSeries::setModelMapping(int modelX, int modelY, Qt::Orientation orientation)
172 Sets the \a modelX to be used as a data source for x coordinate and \a modelY to be used
172 Sets the \a modelX to be used as a data source for x coordinate and \a modelY to be used
173 as a data source for y coordinate. The \a orientation paramater specifies whether the data
173 as a data source for y coordinate. The \a orientation paramater specifies whether the data
174 is in columns or in rows.
174 is in columns or in rows.
@@ -478,11 +478,6 void QXYSeries::modelDataRemoved(QModelIndex parent, int start, int end)
478 }
478 }
479
479
480 /*!
480 /*!
481 \fn QAbstractItemModel* QXYSeries::model()
482 Returns the model from which the series takes its data.
483 */
484
485 /*!
486 \fn bool QXYSeries::setModel(QAbstractItemModel *model)
481 \fn bool QXYSeries::setModel(QAbstractItemModel *model)
487 Sets the \a model to be used as a data source
482 Sets the \a model to be used as a data source
488 \sa setModelMapping(), setModelMappingRange()
483 \sa setModelMapping(), setModelMappingRange()
General Comments 0
You need to be logged in to leave comments. Login now