C

Qt Quick Ultralite charts Example

/****************************************************************************** ** ** Copyright (C) 2020 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Quick Ultralite module. ** ** $QT_BEGIN_LICENSE:COMM$ ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see http://www.qt.io/terms-conditions. For further ** information use the contact form at http://www.qt.io/contact-us. ** ** $QT_END_LICENSE$ ** ******************************************************************************/
import QtQuick 2.15 import QtCharts 2.15 ChartView { title: "Test plot" titleFont.pixelSize: 12 margins.left: 50 margins.right: 50 margins.bottom: 50 margins.top: 50 BarSeries { barWidth: 0.8 axisX: BarCategoryAxis { labelsFont.pixelSize: 10 BarCategoryValue { value: "2007" } BarCategoryValue { value: "2008" } BarCategoryValue { value: "2009" } BarCategoryValue { value: "2010" } } axisY: ValueAxis { labelsFont.pixelSize: 10 labelFormat: "%.1f" } BarSet { BarSetValue { id: barVal1 value: 1 Behavior on value { NumberAnimation { duration: 1000 } } } BarSetValue { value: 2 } BarSetValue { value: 6 } BarSetValue { value: 3 } } BarSet { BarSetValue { value: 1 } BarSetValue { value: 5 } BarSetValue { value: 2 } BarSetValue { value: 3 } } BarSet { BarSetValue { value: 1 } BarSetValue { value: 5 } BarSetValue { value: 2 } BarSetValue { value: 3 } } BarSet { BarSetValue { value: 1 } BarSetValue { value: 5 } BarSetValue { value: 2 } BarSetValue { value: 3 } } BarSet { BarSetValue { value: 1 } BarSetValue { value: 5 } BarSetValue { value: 2 } BarSetValue { value: 3 } } } Timer { running: true repeat: true interval: 1000 onTriggered: { barVal1.value = 7 * Math.random() } } }