summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMiikka Heikkinen <miikka.heikkinen@qt.io>2016-09-21 14:45:41 +0300
committerMiikka Heikkinen <miikka.heikkinen@qt.io>2016-09-23 09:55:41 +0000
commit3cb2c5e7572a75a4fae8883c9c0f3141cdf207b9 (patch)
tree1fa529e85c919755d9d4048b8240a6876d34199a /tests
parent06c412094b60517af015637322798da6224e34c2 (diff)
Add a possibility to change legend marker shape
It is now possible to choose between rectangular, circular, and "from series" shapes for legend markers. The "from series" shape uses scatter dot items as legend markers in case of scatter series and a line segment for line and spline series. Task-number: QTBUG-50682 Change-Id: I58977ead88e1274e1f163516d32c4d290f4410f9 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/manual/qmlchartproperties/qml/qmlchartproperties/ChartEditorLegend.qml12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/manual/qmlchartproperties/qml/qmlchartproperties/ChartEditorLegend.qml b/tests/manual/qmlchartproperties/qml/qmlchartproperties/ChartEditorLegend.qml
index 81bc82dd..534127b2 100644
--- a/tests/manual/qmlchartproperties/qml/qmlchartproperties/ChartEditorLegend.qml
+++ b/tests/manual/qmlchartproperties/qml/qmlchartproperties/ChartEditorLegend.qml
@@ -28,6 +28,7 @@
****************************************************************************/
import QtQuick 2.0
+import QtCharts 2.2
Row {
anchors.fill: parent
@@ -78,6 +79,17 @@ Row {
text: "legend use reverse order"
onClicked: chartLegend.reverseMarkers = !chartLegend.reverseMarkers;
}
+ Button {
+ text: "legend marker shape"
+ onClicked: {
+ if (chartLegend.markerShape === Legend.MarkerShapeRectangle)
+ chartLegend.markerShape = Legend.MarkerShapeCircle
+ else if (chartLegend.markerShape === Legend.MarkerShapeCircle)
+ chartLegend.markerShape = Legend.MarkerShapeFromSeries
+ else
+ chartLegend.markerShape = Legend.MarkerShapeRectangle
+ }
+ }
}
FontEditor {