Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. How to plot chart dynamically?

How to plot chart dynamically?

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
2 Posts 2 Posters 532 Views 1 Watching
  • 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.
  • D Offline
    D Offline
    drd1988on
    wrote on last edited by drd1988on
    #1

    Hi
    I wants to update my chart dynamically.
    My code is not working
    Below is my code

          ChartView {
            id:idChart
            title: "Line"
            width:400
            height: 400
            x:-200
            backgroundColor: "transparent"
            titleColor: "white"
            y:40
            visible: false
            antialiasing: true
      
            LineSeries {
                name: "LineSeries"
                id:idLine
    
                axisY: CategoryAxis {
                    labelsColor: "white"
    
    
                    min: 0
                    max: 200
                    CategoryRange {
                        label: "50"
                        endValue: 50
                    }
                    CategoryRange {
                        label: "100"
                        endValue: 100
                    }
                    CategoryRange {
                        label: "150"
                        endValue: 150
                    }
                    CategoryRange {
                        label: "200"
                        endValue: 200
                    }
    
                }
                axisX: CategoryAxis {
                    labelsColor: "white"
                    id:idXaxis
                    min: 0
                    max: 400
    
    
                }
    
    
            }
        Component.onCompleted:{
           manager.initialise();
          manager.value();
    
        }
        }
        Connections{
            target: manager
            onSetmVal:{
    
               
                aqIY[counter%6] = manager.getCurrentmValue();
                timeX[counter%6] =manager.getCurrentTime();
            
                var axisRange = 50*(counter%6);
                idXaxis.append(manager.getCurrentTime(),axisRange);
                idLine.append(manager.getCurrentTime(),manager.getCurrentmValue());
                counter++;
                console.log("aqIY Val====",aqIY.length,"timeX",timeX,"aQI",aqIY)
            }
    
    1 Reply Last reply
    0
    • oria66O Offline
      oria66O Offline
      oria66
      wrote on last edited by
      #2

      Hi @drd1988on. Check these posts:

      https://forum.qt.io/topic/88318/chartview-with-a-circular-buffer
      https://forum.qt.io/topic/93398/sliding-grid-for-chart.

      Good luck

      The truth is out there

      1 Reply Last reply
      0

      • Login

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