Warning, /libraries/kqtquickcharts/demo/minimal/main.qml is written in an unsupported language. File is not indexed.

0001 /*
0002  *  Copyright 2014  Sebastian Gottfried <sebastiangottfried@web.de>
0003  *
0004  *  This library is free software; you can redistribute it and/or
0005  *  modify it under the terms of the GNU Lesser General Public
0006  *  License as published by the Free Software Foundation; either
0007  *  version 2.1 of the License, or (at your option) version 3, or any
0008  *  later version accepted by the membership of KDE e.V. (or its
0009  *  successor approved by the membership of KDE e.V.), which shall
0010  *  act as a proxy defined in Section 6 of version 3 of the license.
0011  *
0012  *  This library is distributed in the hope that it will be useful,
0013  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
0014  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0015  *  Lesser General Public License for more details.
0016  *
0017  *  You should have received a copy of the GNU Lesser General Public
0018  */
0019 
0020 import QtQuick 2.2
0021 import org.kde.charts 0.1
0022 
0023 Rectangle {
0024     color: "white"
0025     width: 800
0026     height: 400
0027 
0028     ChartModel {
0029         id: chartModel
0030         columns: 2
0031 
0032         Record {
0033             values: [0.1, 0.2]
0034         }
0035         Record {
0036             values: [0.25, 0.3]
0037         }
0038         Record {
0039             values: [0.5, 0.5]
0040         }
0041         Record {
0042             values: [1.0, 0.75]
0043         }
0044     }
0045 
0046     Column {
0047         anchors.fill: parent
0048         anchors.margins: 20
0049         spacing: 20
0050 
0051         LineChart {
0052             model: chartModel
0053             width: parent.width
0054             height: parent.height - legend.height - parent.spacing
0055             pitch: 180
0056             dimensions: [
0057                 Dimension {
0058                     id: funDimension
0059                     color: "#ffd500"
0060                     dataColumn: 0
0061                     minimumValue: 0.0
0062                     maximumValue: 1.0
0063                     label: "Fun"
0064                     precision: 0
0065                     unit:" %"
0066                     unitFactor: 100.0
0067                 },
0068                 Dimension {
0069                     id: profitDimension
0070                     color: "#ff0000"
0071                     dataColumn: 1
0072                     minimumValue: 0.0
0073                     maximumValue: 1.0
0074                     label: "Profit"
0075                     precision: 0
0076                     unit:" %"
0077                     unitFactor: 100.0
0078                 }
0079             ]
0080         }
0081 
0082         Row {
0083             id: legend
0084             spacing: 30
0085             anchors.horizontalCenter: parent.horizontalCenter
0086 
0087             LegendItem {
0088                 dimension: funDimension
0089             }
0090             LegendItem {
0091                 dimension: profitDimension
0092             }
0093         }
0094     }
0095 }