Quantcast
Channel: Qt DevNet forums: Qt Quick 1283365070**
Viewing all articles
Browse latest Browse all 4972

DateTimeAxis - How to set min and max?

$
0
0
Hi, I’m working on a chart which should show the time from 0 to 24 h on the x axis. Is there any example out there? My code snippet: import QtQuick 2.3 import QtQuick.Controls 1.2 import QtCharts 2.0   Rectangle {     id: detailRectangle     anchors.fill: parent       ChartView {         title: "Line"         anchors.fill: parent         antialiasing: true           LineSeries {             axisY: ValueAxis {                 min: 0                 max: 1                 titleText: "kWh"             }               axisX: DateTimeAxis {                 format: "hh:mm"                 tickCount: 5                 min: new Date("October 13, 2014 11:13:00");                 max: new Date("October 13, 2014 13:13:00");             }               name: "LineSeries"             XYPoint { x: 0; y: 0 }             XYPoint { x: 1.1; y: 2.1 }             XYPoint { x: 1.9; y: 3.3 }             XYPoint { x: 2.1; y: 2.1 }             XYPoint { x: 2.9; y: 4.9 }             XYPoint { x: 3.4; y: 3.0 }             XYPoint { x: 4.1; y: 3.3 }         }     }     }

Viewing all articles
Browse latest Browse all 4972

Trending Articles