Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. timer with graph in qml
Forum Updated to NodeBB v4.3 + New Features

timer with graph in qml

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
1 Posts 1 Posters 192 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Sunil kumar verma
    wrote on 21 Mar 2023, 06:32 last edited by
    #1

    timer with graph in qml .

    timer was not match with stop watch after 3000 x axis
    and interval is 10milisecond.

    please help me how resolve??
    import QtQuick 2.15
    import QtQuick.Window 2.15
    import QtCharts 2.3
    Window {
    width: 1000
    height: 480
    visible: true
    title: qsTr("Hello World")
    property int xx: 0
    property int yy: 0
    property int zz: 0
    property real aa: 00
    property real bb: 20
    //property int point11: 0

    Rectangle {
        width: 1000
        height: 300
    
        ChartView {
            id: chart
            anchors.fill: parent
    
            // Define the chart axes
            ValueAxis {
                id: valueAxis
                min: 0
                max: 10
                titleText: "ValueY"
            }
            ValueAxis {
                id: valueAxisX
                min: 0
                max: 1000
                tickCount: 11
                titleText: "ValueX"
            }
    
            LineSeries {
                id: series
                axisX: valueAxisX
                axisY: valueAxis
                name: "Series"
            }
            Timer {
                id: timer
                interval: 10
                running: true
                repeat: true
                property int amountOfData: 0
                onTriggered: {
    
                     aa++
                     bb = Math.random() * 10;
                    console.log(aa)
    

    // series.append(aa,bb)
    if(amountOfData>valueAxisX.max)
    {
    valueAxisX.max++
    valueAxisX.min++
    }
    else
    {
    amountOfData++
    }

                }
            }
        }
    }
    

    }

    1 Reply Last reply
    0

    1/1

    21 Mar 2023, 06:32

    • Login

    • Login or register to search.
    1 out of 1
    • First post
      1/1
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved