diff options
author | Titta Heikkala <titta.heikkala@qt.io> | 2017-02-17 11:39:00 +0200 |
---|---|---|
committer | Otto Ryynänen <otto.ryynanen@qt.io> | 2017-02-17 11:21:45 +0000 |
commit | 2309013b405ad37a20c4be827eba2b064f5f1644 (patch) | |
tree | 6940c475664c0d96a74782e945639981332cec48 /tradeshow/iot-sensortag/resources | |
parent | 4a1911326d614da88aabb3baa7c57b808ebbaf99 (diff) |
iot-sensortag: Change Magnetometer chart type
Magnetometer chart changed from polar chart view to chart view. Also
changed the series to LineSeries.
Change-Id: Ibdf2dc1c86e63fd20caa8d3c1a09377ea6de8f4b
Reviewed-by: Otto Ryynänen <otto.ryynanen@qt.io>
Diffstat (limited to 'tradeshow/iot-sensortag/resources')
-rw-r--r-- | tradeshow/iot-sensortag/resources/base/MagnetometerChart.qml | 64 | ||||
-rw-r--r-- | tradeshow/iot-sensortag/resources/small/images/Magnetometer/grid.png | bin | 41105 -> 0 bytes |
2 files changed, 22 insertions, 42 deletions
diff --git a/tradeshow/iot-sensortag/resources/base/MagnetometerChart.qml b/tradeshow/iot-sensortag/resources/base/MagnetometerChart.qml index 3bac8e6..29458f6 100644 --- a/tradeshow/iot-sensortag/resources/base/MagnetometerChart.qml +++ b/tradeshow/iot-sensortag/resources/base/MagnetometerChart.qml @@ -58,9 +58,9 @@ BaseChart { property int maxNumOfMagnReadings: 24 readonly property color chartColor: "#15bdff" - readonly property string xColor: "#15bdff" + readonly property string xColor: "#4db300" readonly property string yColor: "white" - readonly property string zColor: "red" + readonly property string zColor: "#f64405" readonly property color textColor: "white" title: qsTr("Magnetometer") @@ -77,31 +77,23 @@ BaseChart { } } - Image { - anchors.fill: parent - source: pathPrefix + "Magnetometer/grid.png" - } - Glow { anchors.fill: chartView radius: 18 samples: 30 - color: "red" + color: zColor source: chartView } - - PolarChartView { + ChartView { id: chartView anchors.top: parent.top - anchors.topMargin: -8 anchors.bottom: parent.bottom - anchors.bottomMargin: -10 + anchors.bottomMargin: 25 anchors.left: parent.left - anchors.leftMargin: -60 + anchors.leftMargin: -20 anchors.right: parent.right - anchors.rightMargin: 30 antialiasing: true backgroundColor: "transparent" legend.visible: false @@ -112,19 +104,18 @@ BaseChart { ValueAxis { id: valueAxisX min: 0 - max: maxNumOfMagnReadings + max: maxNumOfMagnReadings + 1 visible: false } ValueAxis { id: valueAxisY - - min: -1000 - max: 1000 + min: -2000 + max: 2000 visible: false } - SplineSeries { + LineSeries { id: magnSeriesX axisX: valueAxisX axisY: valueAxisY @@ -132,7 +123,7 @@ BaseChart { name: "Magnet X" useOpenGL: true } - SplineSeries { + LineSeries { id: magnSeriesY axisX: valueAxisX axisY: valueAxisY @@ -140,7 +131,7 @@ BaseChart { name: "Magnet Y" useOpenGL: true } - SplineSeries { + LineSeries { id: magnSeriesZ axisX: valueAxisX axisY: valueAxisY @@ -150,34 +141,24 @@ BaseChart { } } - Column { - id: labelColumn + Row { + id: labelRow anchors.fill: parent - anchors.rightMargin: 20 + anchors.leftMargin: 16 Repeater { model: 3 Item { - height: labelColumn.height / 3 - width: labelColumn.width + height: labelRow.height + width: labelRow.width / 3 Text { id: coordText text: (index == 0) ? "X" : ((index == 1) ? "Y" : "Z") - color: "white" - anchors.right: parent.right - anchors.top: parent.top - horizontalAlignment: Text.AlignRight - width: contentWidth - } - - Rectangle { color: (index == 0) ? xColor : ((index == 1) ? yColor : zColor) - anchors.right: parent.right - anchors.top: coordText.bottom - height: 1 - width: parent.width / 8 + anchors.left: parent.left + anchors.bottom: parent.bottom } Text { @@ -186,10 +167,9 @@ BaseChart { sensor.magnetometerMicroT_zAxis) ) : "" color: "white" - anchors.right: parent.right - anchors.top: coordText.bottom - horizontalAlignment: Text.AlignRight - width: contentWidth + anchors.left: coordText.right + anchors.leftMargin: 16 + anchors.bottom: parent.bottom } } } diff --git a/tradeshow/iot-sensortag/resources/small/images/Magnetometer/grid.png b/tradeshow/iot-sensortag/resources/small/images/Magnetometer/grid.png Binary files differdeleted file mode 100644 index 314ca99..0000000 --- a/tradeshow/iot-sensortag/resources/small/images/Magnetometer/grid.png +++ /dev/null |