How to use model to update Chart data



  • 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.