Error: Can not find series on the chart



  • It is running properly, But when i am closing application this error is coming , Can anybody tell why this error is coming.

    ChartView
        {
            id:chrt
            height: parent.height/2
            width: parent.width+18.5
            x:-9.2
            antialiasing: true
            legend.visible: false
            backgroundRoundness: 0
            margins.top: 20
            margins.bottom: 1
            margins.left: 1
            margins.right: 1
            backgroundColor: "black"
    
            ValueAxis
            {
                id:x_axis
                min: 0
                max: 50
                tickCount: 6
                visible: false
            }
    
            ValueAxis
            {
                id:y_axis
                min: 0
                max: 5
                tickCount: 6
                visible: false
            }
    
            ValueAxis
            {
                id:y_axis_right
                min: 0
                max: 5
                tickCount: 6
                visible: false
            }
    
            LineSeries
            {
                id:l1
                axisX: x_axis
                axisY: y_axis
                color: "#969FB2"
                width: 3.5
                XYPoint { x: x_variable_chrt_1+0; y: y_variable_chrt_1+0 }
                XYPoint { x: x_variable_chrt_1+0; y: y_variable_chrt_1+5 }
                XYPoint { x: x_variable_chrt_1+50; y: y_variable_chrt_1+5 }
                XYPoint { x: x_variable_chrt_1+50; y: y_variable_chrt_1+0 }
                XYPoint { x: x_variable_chrt_1+0; y: y_variable_chrt_1+0 }
            }
    
            LineSeries
            {
                id:l2
                axisX: x_axis
                axisY: y_axis
                color: "#969FB2"
                width: 2
                XYPoint { x: x_variable_chrt_1+10; y: y_variable_chrt_1+5 }
                XYPoint { x: x_variable_chrt_1+10; y: y_variable_chrt_1+0 }
                XYPoint { x: x_variable_chrt_1+20; y: y_variable_chrt_1+0 }
                XYPoint { x: x_variable_chrt_1+20; y: y_variable_chrt_1+5 }
                XYPoint { x: x_variable_chrt_1+30; y: y_variable_chrt_1+5 }
                XYPoint { x: x_variable_chrt_1+30; y: y_variable_chrt_1+0 }
                XYPoint { x: x_variable_chrt_1+40; y: y_variable_chrt_1+0 }
                XYPoint { x: x_variable_chrt_1+40; y: y_variable_chrt_1+5 }
                XYPoint { x: x_variable_chrt_1+50; y: y_variable_chrt_1+5 }
            }
    
            LineSeries
            {
                id:l3
                axisX: x_axis
                axisY: y_axis
                color: "#969FB2"
                XYPoint { x: x_variable_chrt_1+50; y: y_variable_chrt_1+3.34 }
                XYPoint { x: x_variable_chrt_1+0; y: y_variable_chrt_1+3.34 }
                XYPoint { x: x_variable_chrt_1+0; y: y_variable_chrt_1+1.67 }
                XYPoint { x: x_variable_chrt_1+50; y: y_variable_chrt_1+1.67 }
                style: Qt.DotLine
            }
        }
    
        // ChartView 2
        ChartView
        {
            id:chrt2
            height: parent.height/2
            width: parent.width+18.5
            x:-9.2
            antialiasing: true
            anchors.top: chrt.bottom
            legend.visible: false
            backgroundRoundness: 0
            margins.top: 15
            margins.bottom: 1
            margins.left: 1
            margins.right: 1
            backgroundColor: "black"
    
            ValueAxis
            {
                id:x_axis_2
                min: 0
                max: 50
                tickCount: 6
                visible: false
            }
    
            ValueAxis
            {
                id:y_axis_2
                min: 0
                max: 5
                tickCount: 6
                visible: false
            }
    
            ValueAxis
            {
                id:y_axis_right_2
                min: 0
                max: 5
                tickCount: 6
                visible: false
            }
    
            LineSeries
            {
                id:l1_2
                axisX: x_axis
                axisY: y_axis
                color: "#969FB2"
                width: 3.5
                XYPoint { x: x_variable_chrt_1+0; y: y_variable_chrt_1+0 }
                XYPoint { x: x_variable_chrt_1+0; y: y_variable_chrt_1+5 }
                XYPoint { x: x_variable_chrt_1+50; y: y_variable_chrt_1+5 }
                XYPoint { x: x_variable_chrt_1+50; y: y_variable_chrt_1+0 }
                XYPoint { x: x_variable_chrt_1+0; y: y_variable_chrt_1+0 }
            }
    
            LineSeries
            {
                id:l2_2
                axisX: x_axis
                axisY: y_axis
                color: "#969FB2"
                width: 2
                XYPoint { x: x_variable_chrt_1+10; y: y_variable_chrt_1+5 }
                XYPoint { x: x_variable_chrt_1+10; y: y_variable_chrt_1+0 }
                XYPoint { x: x_variable_chrt_1+20; y: y_variable_chrt_1+0 }
                XYPoint { x: x_variable_chrt_1+20; y: y_variable_chrt_1+5 }
                XYPoint { x: x_variable_chrt_1+30; y: y_variable_chrt_1+5 }
                XYPoint { x: x_variable_chrt_1+30; y: y_variable_chrt_1+0 }
                XYPoint { x: x_variable_chrt_1+40; y: y_variable_chrt_1+0 }
                XYPoint { x: x_variable_chrt_1+40; y: y_variable_chrt_1+5 }
                XYPoint { x: x_variable_chrt_1+50; y: y_variable_chrt_1+5 }
            }
    
            LineSeries
            {
                id:l3_2
                axisX: x_axis
                axisY: y_axis
                color: "#969FB2"
                XYPoint { x: x_variable_chrt_1+50; y: y_variable_chrt_1+3.34 }
                XYPoint { x: x_variable_chrt_1+0; y: y_variable_chrt_1+3.34 }
                XYPoint { x: x_variable_chrt_1+0; y: y_variable_chrt_1+1.67 }
                XYPoint { x: x_variable_chrt_1+50; y: y_variable_chrt_1+1.67 }
                style: Qt.DotLine
            }
        }
    
    


  • @Bhushan_Sure
    In this above code, there are more than one chartview component in one qml.
    I separated chartview in different qml and tried to load this different qml files into one, so i didn't got this error.

    If anyone got same issue in future, try using loader component and define chartview in different different qml files.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.