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 use model to update Chart data

How to use model to update Chart data

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
qmlchartmodeltableview tablewidget
1 Posts 1 Posters 954 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
    SaranshVora
    wrote on 22 Mar 2017, 17:56 last edited by
    #1

    Hello Everyone,
    I am using this example only the cpp file and my qml code is :

    /// this is the name of my model as given in the above example. I have just used customtablemodel.cpp and changed it to ScopeDataModel.cpp
     ScopeDataModel{ 
            id:scopeModel
    
        }
      ChartView
        {
            id: chartView
            title: " Scope "
            anchors.fill: parent
            legend.visible: false
            antialiasing: true
            backgroundColor: "white"
            plotAreaColor: "white"
            titleColor: "white"
    
            ValueAxis {
                id: axisX
                titleText:componentData.readXAxisName
                min: componentData.changeXMin
                max: componentData.changeXMax
                tickCount: 1
            }
    
            ValueAxis {
                id: axisY
                titleText:componentData.readYAxisName
                min: componentData.changeYMin
                max: componentData.changeYMax
                tickCount: 1
            }
    
            LineSeries {
    
                id: lineSeries
                name: "Data Output"
                axisX: axisX
                axisY: axisY
                useOpenGL: true
                VXYModelMapper{
                model:scopeModel
                xColumn:0
                yColumn:1
                series:lineSeries
                }
            }
        }
    

    How can I use this model to instantiate tableview and other details in my code ?
    Because I tried doing it like this but it did not update my data on the chart.

    1 Reply Last reply
    0

    1/1

    22 Mar 2017, 17:56

    • 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