X-Git-Url: https://www.flypig.org.uk/git/?p=harbour-pedalo.git;a=blobdiff_plain;f=qml%2Fpages%2FStats.qml;fp=qml%2Fpages%2FStats.qml;h=ad2dcae232d12711b7924d88d2fbe574ffe5a21c;hp=39ccc793dad31a6b5bca016287d4b52dcdda8dc9;hb=41ee443df2b12e7a4373be580006f57cc5fd768a;hpb=48ad3a8b6ff3c5a9101e0662a0c454765653789a diff --git a/qml/pages/Stats.qml b/qml/pages/Stats.qml index 39ccc79..ad2dcae 100644 --- a/qml/pages/Stats.qml +++ b/qml/pages/Stats.qml @@ -1,5 +1,6 @@ import QtQuick 2.0 import Sailfish.Silica 1.0 +import harbour.pedalo.graph 1.0 import "../components" Page { @@ -70,5 +71,39 @@ Page { horizontalAlignment: Text.AlignRight } } + + Column { + id: graphsColumn + spacing: Theme.paddingLarge + width: isPortrait ? parent.width : parent.width * 0.5 + y: (isPortrait ? (statsPage.height / 2.0) : statsColumn.y) + anchors.left: isPortrait ? statsColumn.left : statsColumn.right + anchors.leftMargin: Theme.horizontalPageMargin + + + Graph { + id: graph + width: parent.width - 2 * Theme.horizontalPageMargin + height: isPortrait ? (statsPage.height / 2.0) - Theme.paddingLarge : statsPage.height - Theme.paddingLarge - headerItem.height + model: currentStatus.getGraphData() + labelsx: ["M", "T", "W", "Th", "F", "S", "Su", "A", "B", "C"] + //labelsy: ["0%", "10%", "20%", "30%", "40%", "50%", "60%", "70%", "80%", "90%", "100%"] + unitsy: "%" + primary: Theme.primaryColor + secondary: Theme.highlightColor + highlight: Theme.highlightColor + miny: 0.0 + maxy: 1.0 + stepy: 0.1 + gap: 0.1 + fontsize: Theme.fontSizeExtraSmall + PropertyAnimation on animate { + duration: 2000 + easing.type: Easing.InOutExpo + from: 0.0 + to: 1.0 + } + } + } } }