diff options
author | Titta Heikkala <titta.heikkala@theqtcompany.com> | 2015-06-17 13:13:45 +0300 |
---|---|---|
committer | Titta Heikkala <titta.heikkala@theqtcompany.com> | 2015-07-03 07:51:57 +0000 |
commit | 7c9f8e5a27d8b5570d700aa992a35077f2022c4a (patch) | |
tree | 79e29559b653833134abea08671b6175bf443b8f /tests/manual | |
parent | 740f4f94adf83f2613161f2ff578ff37eeb89dc6 (diff) |
Add possibility to set reverse values to axes
Added support for reverse axis. This works with line, spline, scatter
and area series with cartesian chart. QBarCategoryAxis is not supported,
nor different bar series.
Change-Id: I60f21372ea9cee7b49918d7d99de24671bdc42c3
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@theqtcompany.com>
Diffstat (limited to 'tests/manual')
4 files changed, 22 insertions, 12 deletions
diff --git a/tests/manual/qmlchartaxis/qml/qmlchartaxis/ChartAxes.qml b/tests/manual/qmlchartaxis/qml/qmlchartaxis/ChartAxes.qml index 5913dff2..e7dfdec7 100644 --- a/tests/manual/qmlchartaxis/qml/qmlchartaxis/ChartAxes.qml +++ b/tests/manual/qmlchartaxis/qml/qmlchartaxis/ChartAxes.qml @@ -23,23 +23,13 @@ ChartView { id: chartView title: "chart axes" - // TODO: Do we need a property for orientation or properties "axisX" and "axisY" on ChartView - // to make an axis the default axis for all series with no other axes defined...? -// ValueAxis { -// orientation: ValueAxis.AxisX -// min: 0 -// max: 10 -// } -// axisX: ValueAxis { -// min: 0 -// max: 10 -// } - // ...Now that we don't have this implementation, the following axes won't have any affect: ValueAxis { + id: valueAxisX min: 0 max: 10 } ValueAxis { + id: valueAxisY min: 0 max: 5 } @@ -51,6 +41,8 @@ ChartView { XYPoint { x: 2; y: 2 } XYPoint { x: 3; y: 3 } XYPoint { x: 4; y: 4 } + axisX: valueAxisX + axisY: valueAxisY } ScatterSeries { @@ -64,6 +56,8 @@ ChartView { XYPoint { x: 2; y: 2 } XYPoint { x: 3; y: 3 } XYPoint { x: 4; y: 4 } + axisX: valueAxisX + axisY: valueAxisY } // Component.onCompleted: { diff --git a/tests/manual/qmlchartaxis/qml/qmlchartaxis/ChartAxesRevert.qml b/tests/manual/qmlchartaxis/qml/qmlchartaxis/ChartAxesRevert.qml index 0855b3ec..851db4d6 100644 --- a/tests/manual/qmlchartaxis/qml/qmlchartaxis/ChartAxesRevert.qml +++ b/tests/manual/qmlchartaxis/qml/qmlchartaxis/ChartAxesRevert.qml @@ -24,10 +24,12 @@ ChartView { title: "chart axes reverted" ValueAxis { + id: valueAxisX min: 0 max: 10 } ValueAxis { + id: valueAxisY min: 0 max: 5 } @@ -43,6 +45,8 @@ ChartView { XYPoint { x: 2; y: 2 } XYPoint { x: 3; y: 3 } XYPoint { x: 4; y: 4 } + axisX: valueAxisX + axisY: valueAxisY } LineSeries { @@ -52,5 +56,7 @@ ChartView { XYPoint { x: 2; y: 2 } XYPoint { x: 3; y: 3 } XYPoint { x: 4; y: 4 } + axisX: valueAxisX + axisY: valueAxisY } } diff --git a/tests/manual/qmlchartproperties/qml/qmlchartproperties/Chart.qml b/tests/manual/qmlchartproperties/qml/qmlchartproperties/Chart.qml index 4294da53..e15b1372 100644 --- a/tests/manual/qmlchartproperties/qml/qmlchartproperties/Chart.qml +++ b/tests/manual/qmlchartproperties/qml/qmlchartproperties/Chart.qml @@ -34,6 +34,8 @@ ChartView { XYPoint { x: 2.9; y: 4.9 } XYPoint { x: 3.4; y: 3.0 } XYPoint { x: 4.1; y: 3.3 } + axisX: axisX + axisY: axisY } onVisibleChanged: console.log("chart.onVisibleChanged: " + visible); @@ -65,6 +67,7 @@ ChartView { } ValueAxis{ + id: axisX onColorChanged: console.log("axisX.onColorChanged: " + color); onLabelsVisibleChanged: console.log("axisX.onLabelsVisibleChanged: " + visible); onLabelsColorChanged: console.log("axisX.onLabelsColorChanged: " + color); @@ -75,9 +78,11 @@ ChartView { onShadesBorderColorChanged: console.log("axisX.onShadesBorderColorChanged: " + color); onMinChanged: console.log("axisX.onMinChanged: " + min); onMaxChanged: console.log("axisX.onMaxChanged: " + max); + onReverseChanged: console.log("axisX.onReverseChanged: " + reverse); } ValueAxis{ + id: axisY onColorChanged: console.log("axisY.onColorChanged: " + color); onLabelsVisibleChanged: console.log("axisY.onLabelsVisibleChanged: " + visible); onLabelsColorChanged: console.log("axisY.onLabelsColorChanged: " + color); @@ -88,6 +93,7 @@ ChartView { onShadesBorderColorChanged: console.log("axisY.onShadesBorderColorChanged: " + color); onMinChanged: console.log("axisY.onMinChanged: " + min); onMaxChanged: console.log("axisY.onMaxChanged: " + max); + onReverseChanged: console.log("axisY.onReverseChanged: " + reverse); } Rectangle { diff --git a/tests/manual/qmlchartproperties/qml/qmlchartproperties/ChartEditorAxis.qml b/tests/manual/qmlchartproperties/qml/qmlchartproperties/ChartEditorAxis.qml index c821c891..dedd14d9 100644 --- a/tests/manual/qmlchartproperties/qml/qmlchartproperties/ChartEditorAxis.qml +++ b/tests/manual/qmlchartproperties/qml/qmlchartproperties/ChartEditorAxis.qml @@ -105,6 +105,10 @@ Row { onClicked: axis.tickCount--; } + Button { + text: "axis reverse" + onClicked: axis.reverse = !axis.reverse; + } FontEditor { id: fontEditor |