summaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorTero Ahola <tero.ahola@digia.com>2012-09-03 15:28:33 +0300
committerTero Ahola <tero.ahola@digia.com>2012-09-03 15:31:45 +0300
commit1def3447669a84c91f855335533552ad677c593c (patch)
treeff29cd484d4283f08fab9f26322d5daa03af64a1 /plugins
parenta62b3bfbefaac8b82db669cdfcdd00c3bfade915 (diff)
Added removeSeries and removeAllSeries to QML API
Diffstat (limited to 'plugins')
-rw-r--r--plugins/declarative/declarativechart.cpp10
-rw-r--r--plugins/declarative/declarativechart.h3
2 files changed, 12 insertions, 1 deletions
diff --git a/plugins/declarative/declarativechart.cpp b/plugins/declarative/declarativechart.cpp
index dce629f7..218132ac 100644
--- a/plugins/declarative/declarativechart.cpp
+++ b/plugins/declarative/declarativechart.cpp
@@ -174,6 +174,16 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE
*/
/*!
+ \qmlmethod ChartView::removeSeries(AbstractSeries series)
+ Removes the \a series from the chart. The series object is also destroyed.
+*/
+
+/*!
+ \qmlmethod ChartView::removeAllSeries()
+ Removes all series from the chart. All the series objects are also destroyed.
+*/
+
+/*!
\qmlmethod Axis ChartView::axisY(QAbstractSeries *series)
The y-axis of the series. This is the same as the default y-axis of the chart as multiple y-axes are not yet supported.
*/
diff --git a/plugins/declarative/declarativechart.h b/plugins/declarative/declarativechart.h
index 2f03bbce..11cdfcc9 100644
--- a/plugins/declarative/declarativechart.h
+++ b/plugins/declarative/declarativechart.h
@@ -122,12 +122,13 @@ public:
Q_INVOKABLE QAbstractSeries *series(int index);
Q_INVOKABLE QAbstractSeries *series(QString seriesName);
Q_INVOKABLE QAbstractSeries *createSeries(DeclarativeChart::SeriesType type, QString name = "");
+ Q_INVOKABLE void removeSeries(QAbstractSeries *series) { m_chart->removeSeries(series); }
+ Q_INVOKABLE void removeAllSeries() { m_chart->removeAllSeries(); }
Q_INVOKABLE void setAxisX(QAbstractAxis *axis, QAbstractSeries *series = 0);
Q_INVOKABLE void setAxisY(QAbstractAxis *axis, QAbstractSeries *series = 0);
Q_INVOKABLE void createDefaultAxes();
Q_INVOKABLE QAbstractAxis *axisX(QAbstractSeries *series = 0);
Q_INVOKABLE QAbstractAxis *axisY(QAbstractSeries *series = 0);
-
Q_INVOKABLE void zoom(qreal factor);
Q_INVOKABLE void scrollLeft(qreal pixels);
Q_INVOKABLE void scrollRight(qreal pixels);