@@ -14,6 +14,7 | |||||
14 | representation of different types of QChartSeries and other chart related objects like |
|
14 | representation of different types of QChartSeries and other chart related objects like | |
15 | QChartAxis and QChartLegend. If you simply want to show a chart in a layout, you can use the |
|
15 | QChartAxis and QChartLegend. If you simply want to show a chart in a layout, you can use the | |
16 | convenience class QChartView instead of QChart. |
|
16 | convenience class QChartView instead of QChart. | |
|
17 | \sa QChartView | |||
17 | */ |
|
18 | */ | |
18 |
|
19 | |||
19 | QTCOMMERCIALCHART_BEGIN_NAMESPACE |
|
20 | QTCOMMERCIALCHART_BEGIN_NAMESPACE | |
@@ -46,11 +47,22 void QChart::addSeries(QChartSeries* series, QChartAxis* axisY) | |||||
46 | m_dataset->addSeries(series, axisY); |
|
47 | m_dataset->addSeries(series, axisY); | |
47 | } |
|
48 | } | |
48 |
|
49 | |||
|
50 | /*! | |||
|
51 | Removes the QChartSeries specified in a perameter from the QChartView. | |||
|
52 | It releses its ownership of the specified QChartSeries object. | |||
|
53 | It does not delete the pointed QChartSeries data object | |||
|
54 | \sa removeSeries(), removeAllSeries() | |||
|
55 | */ | |||
49 | void QChart::removeSeries(QChartSeries* series) |
|
56 | void QChart::removeSeries(QChartSeries* series) | |
50 | { |
|
57 | { | |
51 | m_dataset->removeSeries(series); |
|
58 | m_dataset->removeSeries(series); | |
52 | } |
|
59 | } | |
53 |
|
60 | |||
|
61 | /*! | |||
|
62 | Removes all the QChartSeries that have been added to the QChartView | |||
|
63 | It also deletes the pointed QChartSeries data objects | |||
|
64 | \sa addSeries(), removeSeries() | |||
|
65 | */ | |||
54 | void QChart::removeAllSeries() |
|
66 | void QChart::removeAllSeries() | |
55 | { |
|
67 | { | |
56 | m_dataset->removeAllSeries(); |
|
68 | m_dataset->removeAllSeries(); | |
@@ -70,12 +82,18 void QChart::setChartBackgroundPen(const QPen& pen) | |||||
70 | m_backgroundItem->update(); |
|
82 | m_backgroundItem->update(); | |
71 | } |
|
83 | } | |
72 |
|
84 | |||
|
85 | /*! | |||
|
86 | Sets the title description text that is rendered above the chart. | |||
|
87 | */ | |||
73 | void QChart::setChartTitle(const QString& title) |
|
88 | void QChart::setChartTitle(const QString& title) | |
74 | { |
|
89 | { | |
75 | createChartTitleItem(); |
|
90 | createChartTitleItem(); | |
76 | m_titleItem->setPlainText(title); |
|
91 | m_titleItem->setPlainText(title); | |
77 | } |
|
92 | } | |
78 |
|
93 | |||
|
94 | /*! | |||
|
95 | Sets the font that is used for rendering the description text that is rendered above the chart. | |||
|
96 | */ | |||
79 | void QChart::setChartTitleFont(const QFont& font) |
|
97 | void QChart::setChartTitleFont(const QFont& font) | |
80 | { |
|
98 | { | |
81 | createChartTitleItem(); |
|
99 | createChartTitleItem(); |
@@ -9,7 +9,13 | |||||
9 |
|
9 | |||
10 | /*! |
|
10 | /*! | |
11 | \class QChartView |
|
11 | \class QChartView | |
12 |
\brief Chart widget |
|
12 | \brief Chart widget | |
|
13 | ||||
|
14 | QChartView is a standalone widget that can display charts. It does not require QGraphicsScene to work. It manages the graphical | |||
|
15 | representation of different types of QChartSeries and other chart related objects like | |||
|
16 | QChartAxis and QChartLegend. If you want to display a chart in your existing QGraphicsScene, you can use the QChart class instead. | |||
|
17 | ||||
|
18 | \sa QChart | |||
13 | */ |
|
19 | */ | |
14 |
|
20 | |||
15 | QTCOMMERCIALCHART_BEGIN_NAMESPACE |
|
21 | QTCOMMERCIALCHART_BEGIN_NAMESPACE | |
@@ -41,16 +47,33 void QChartView::resizeEvent(QResizeEvent *event) | |||||
41 | QWidget::resizeEvent(event); |
|
47 | QWidget::resizeEvent(event); | |
42 | } |
|
48 | } | |
43 |
|
49 | |||
|
50 | /*! | |||
|
51 | Adds the series and optional y axis onto the chart and takes the ownership of the objects. | |||
|
52 | If auto scaling is enabled, re-scales the axes the series is bound to (both the x axis and | |||
|
53 | the y axis). | |||
|
54 | \sa removeSeries, removeAllSeries | |||
|
55 | */ | |||
44 | void QChartView::addSeries(QChartSeries* series,QChartAxis *axisY) |
|
56 | void QChartView::addSeries(QChartSeries* series,QChartAxis *axisY) | |
45 | { |
|
57 | { | |
46 | m_chart->addSeries(series,axisY); |
|
58 | m_chart->addSeries(series,axisY); | |
47 | } |
|
59 | } | |
48 |
|
60 | |||
|
61 | /*! | |||
|
62 | Removes the QChartSeries specified in a perameter from the QChartView. | |||
|
63 | It releses its ownership of the specified QChartSeries object. | |||
|
64 | It does not delete the pointed QChartSeries data object | |||
|
65 | \sa removeSeries(), removeAllSeries() | |||
|
66 | */ | |||
49 | void QChartView::removeSeries(QChartSeries* series) |
|
67 | void QChartView::removeSeries(QChartSeries* series) | |
50 | { |
|
68 | { | |
51 | m_chart->removeSeries(series); |
|
69 | m_chart->removeSeries(series); | |
52 | } |
|
70 | } | |
53 |
|
71 | |||
|
72 | /*! | |||
|
73 | Removes all the QChartSeries that have been added to the QChartView | |||
|
74 | It also deletes the pointed QChartSeries data objects | |||
|
75 | \sa addSeries(), removeSeries() | |||
|
76 | */ | |||
54 | void QChartView::removeAllSeries() |
|
77 | void QChartView::removeAllSeries() | |
55 | { |
|
78 | { | |
56 | m_chart->removeAllSeries(); |
|
79 | m_chart->removeAllSeries(); | |
@@ -71,16 +94,25 void QChartView::zoomOut() | |||||
71 | m_chart->zoomOut(); |
|
94 | m_chart->zoomOut(); | |
72 | } |
|
95 | } | |
73 |
|
96 | |||
|
97 | /*! | |||
|
98 | Returns the chart margin, which is the distance between the widget edge and the axis lines or the chart. | |||
|
99 | */ | |||
74 | int QChartView::margin() const |
|
100 | int QChartView::margin() const | |
75 | { |
|
101 | { | |
76 | return m_chart->margin(); |
|
102 | return m_chart->margin(); | |
77 | } |
|
103 | } | |
78 |
|
104 | |||
|
105 | /*! | |||
|
106 | Sets the title description text that is rendered above the chart. | |||
|
107 | */ | |||
79 | void QChartView::setChartTitle(const QString& title) |
|
108 | void QChartView::setChartTitle(const QString& title) | |
80 | { |
|
109 | { | |
81 | m_chart->setChartTitle(title); |
|
110 | m_chart->setChartTitle(title); | |
82 | } |
|
111 | } | |
83 |
|
112 | |||
|
113 | /*! | |||
|
114 | Sets the font that is used for rendering the description text that is rendered above the chart. | |||
|
115 | */ | |||
84 | void QChartView::setChartTitleFont(const QFont& font) |
|
116 | void QChartView::setChartTitleFont(const QFont& font) | |
85 | { |
|
117 | { | |
86 | m_chart->setChartTitleFont(font); |
|
118 | m_chart->setChartTitleFont(font); | |
@@ -213,11 +245,17 QChart::ChartTheme QChartView::chartTheme() const | |||||
213 | return m_chart->chartTheme(); |
|
245 | return m_chart->chartTheme(); | |
214 | } |
|
246 | } | |
215 |
|
247 | |||
|
248 | /*! | |||
|
249 | Returns the pointer to the x axis object of the chart | |||
|
250 | */ | |||
216 | QChartAxis* QChartView::axisX() const |
|
251 | QChartAxis* QChartView::axisX() const | |
217 | { |
|
252 | { | |
218 | return m_chart->axisX(); |
|
253 | return m_chart->axisX(); | |
219 | } |
|
254 | } | |
220 |
|
255 | |||
|
256 | /*! | |||
|
257 | Returns the pointer to the y axis object of the chart | |||
|
258 | */ | |||
221 | QChartAxis* QChartView::axisY() const |
|
259 | QChartAxis* QChartView::axisY() const | |
222 | { |
|
260 | { | |
223 | return m_chart->axisY(); |
|
261 | return m_chart->axisY(); |
General Comments 0
You need to be logged in to leave comments.
Login now