diff options
author | Tero Ahola <tero.ahola@digia.com> | 2012-09-03 15:28:33 +0300 |
---|---|---|
committer | Tero Ahola <tero.ahola@digia.com> | 2012-09-03 15:31:45 +0300 |
commit | 1def3447669a84c91f855335533552ad677c593c (patch) | |
tree | ff29cd484d4283f08fab9f26322d5daa03af64a1 /tests/qmlchartaxis | |
parent | a62b3bfbefaac8b82db669cdfcdd00c3bfade915 (diff) |
Added removeSeries and removeAllSeries to QML API
Diffstat (limited to 'tests/qmlchartaxis')
-rw-r--r-- | tests/qmlchartaxis/qml/qmlchartaxis/CreatingDynamically.qml | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/qmlchartaxis/qml/qmlchartaxis/CreatingDynamically.qml b/tests/qmlchartaxis/qml/qmlchartaxis/CreatingDynamically.qml index 67ae2b5f..be3a97f8 100644 --- a/tests/qmlchartaxis/qml/qmlchartaxis/CreatingDynamically.qml +++ b/tests/qmlchartaxis/qml/qmlchartaxis/CreatingDynamically.qml @@ -33,10 +33,7 @@ ChartView { onTriggered: { switch (index) { case 0: - while (chartView.count) { - console.log("Destroying series. Count: " + chartView.count); - chartView.series(0).destroy(); - } + var count = chartView.count; var line = chartView.createSeries(ChartView.SeriesTypeLine, "line"); line.append(0, 0); line.append(1, 1); @@ -50,7 +47,7 @@ ChartView { chartView.axisY().min = 0; chartView.axisY().max = 4.5; break; - default: + case 2: var scatter = chartView.createSeries(ChartView.SeriesTypeScatter, "scatter"); scatter.append(0, 0); scatter.append(0.5, 1); @@ -61,8 +58,11 @@ ChartView { scatter.append(2, 2); scatter.append(3, 3); scatter.append(4, 4); + break; + default: + chartView.removeAllSeries(); } - index = (index + 1) % 3; + index = (index + 1) % 4; } } } |