1/* 2 SPDX-FileCopyrightText: 2013 Oindrila Gupta <oindrila.gupta92@gmail.com> 3 SPDX-FileCopyrightText: 2013-2014 Andreas Cord-Landwehr <cordlandwehr@kde.org> 4 5 SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL 6*/ 7 8import QtQuick 2.1 9// import org.kde.plasma.core 0.1 as PlasmaCore 10// import org.kde.plasma.components 0.1 as PlasmaComponents 11// import org.kde.charts 0.1 as Charts 12import artikulate 1.0 13 14Item { 15 id: root 16 17 property TrainingSession session 18 property bool finished : session.isFinished 19 20 onFinishedChanged : { 21 if (finished) { 22 statisticsChartLoader.sourceComponent = statisticsChart 23 } 24 } 25 26 Loader { 27 id: statisticsChartLoader 28 height: Math.round(root.height - 60) 29 width: Math.round(root.width - 20) 30 } 31 32 Rectangle { 33 id: backgroundRect 34 anchors.fill: parent 35 color: Kirigami.Theme.backgroundColor 36 Kirigami.Theme.colorSet: Kirigami.Theme.View 37 z: -1 38 } 39 40 Text { 41 anchors { 42 bottom: backgroundRect.bottom 43 bottomMargin: 10 44 horizontalCenter: backgroundRect.horizontalCenter 45 } 46 text: i18n("Attempts") 47 } 48 49//FIXME after kqtquickcharts is ported 50// Component { 51// id : statisticsChart 52// Column { 53// Row { 54// spacing: 15 55// width: legendWord.width + legendExpression.width + legendSentence.width + legendParagraph.width + 3*15 56// height:legendWord.height*2 57// Item { // dummy 58// width: legendWord.height 59// height: legendWord.height 60// } 61// Charts.LegendItem { 62// id: legendWord 63// anchors.verticalCenter: parent.verticalCenter 64// dimension: wordDimension 65// } 66// Charts.LegendItem { 67// id: legendExpression 68// anchors.verticalCenter: parent.verticalCenter 69// dimension: expressionDimension 70// } 71// Charts.LegendItem { 72// id: legendSentence 73// anchors.verticalCenter: parent.verticalCenter 74// dimension: sentenceDimension 75// } 76// Charts.LegendItem { 77// id: legendParagraph 78// anchors.verticalCenter: parent.verticalCenter 79// dimension: paragraphDimension 80// } 81// } 82// 83// Charts.LineChart { 84// height: Math.round(root.height - 60) 85// width: Math.round(root.width - 20) 86// padding: 20 87// model: LearningProgressModel { 88// id: statistics 89// session: root.session 90// } 91// pitch: 60 92// // textRole: 3 // Qt::ToolTipRole 93// 94// dimensions: [ 95// // words 96// Charts.Dimension { 97// id: wordDimension 98// dataColumn: 0 99// color: "#2DE86C" 100// maximumValue: Math.max(0, Math.ceil(statistics.maximumPhrasesPerTry / 4) * 4) + 5 101// label: i18n("Words") 102// }, 103// // expressions 104// Charts.Dimension { 105// id: expressionDimension 106// dataColumn: 1 107// color: "#327BFF" 108// maximumValue: Math.max(0, Math.ceil(statistics.maximumPhrasesPerTry / 4) * 4) + 5 109// label: i18n("Expressions") 110// }, 111// // sentences 112// Charts.Dimension { 113// id: sentenceDimension 114// dataColumn: 2 115// color: "#FFF13F" 116// maximumValue: Math.max(0, Math.ceil(statistics.maximumPhrasesPerTry / 4) * 4) + 5 117// label: i18n("Sentences") 118// }, 119// // paragraphs 120// Charts.Dimension { 121// id: paragraphDimension 122// dataColumn: 3 123// color: "#E85A02" 124// maximumValue: Math.max(0, Math.ceil(statistics.maximumPhrasesPerTry / 4) * 4) + 5 125// label: i18n("Paragraphs") 126// } 127// ] 128// } 129// } 130// } 131} 132