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. Size Problem , It get reduced after some time
QtWS25 Last Chance

Size Problem , It get reduced after some time

Scheduled Pinned Locked Moved Solved QML and Qt Quick
10 Posts 2 Posters 1.0k 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.
  • Bhushan_SureB Offline
    Bhushan_SureB Offline
    Bhushan_Sure
    wrote on last edited by Bhushan_Sure
    #1

    The right side border of chartview shift's little towards left side after completion of one wave, what i am doing wrong ?
    @J-Hilk @LeLev @Yunus @dheerendra

    Rectangle
    {
        id: top
        color: "black"
        visible: true
        width: 400
        height: 250
        focus: true
        clip: true
    
        function graph_1_scaling()
        {
            console.log("Graph1")
            x_axis.min=x_axis.max-80
        }
    
        //Variables and Array
        property double x_axis_variable_for_wave_1:52
        property double y_axis_variable_for_wave1
        property double y_axis_variable_for_wave2
        property variant items: []
        property int  i:0
    
        // ChartView 1
        ChartView
        {
            id:chrt
            height: parent.height
            width: parent.width+51
            x:-31
            antialiasing: true
            legend.visible: false
            backgroundRoundness: 0
            margins.top: 17
            margins.bottom: 0
            margins.left: 1
            margins.right: 1
            backgroundColor: "black"
    
            ValueAxis
            {
                id:x_axis
                min: 0
                max: 50
                tickCount: 5
                labelsVisible: false
                gridLineColor: "#969FB2"
                color: "#969FB2"
            }
    
            ValueAxis
            {
                id:y_axis
                min: 0
                max: 5
                tickCount: 4
                labelsVisible: false
                gridLineColor: "#969FB2"
                color: "#969FB2"
    
            }
    
            ValueAxis
            {
                id:y_axis_right
                min: 0
                max: 5
                tickCount: 6
                labelsVisible: false
                gridLineColor: "#969FB2"
                color: "#969FB2"
            }
    
            LineSeries
            {
                id:l1
                axisX: x_axis
                axisY: y_axis
                color: "yellow"
            }
    
            LineSeries
            {
                id:l2
                axisX: x_axis
                axisY: y_axis
                color: "Yellow"
                style: Qt.DotLine
            }
    
            Timer
            {
                interval: 1000; repeat: true; running: true
                onTriggered:
                {
                    //Creating Random Y-axis variable for wave 1
                    y_axis_variable_for_wave1= Math.floor(Math.random()*(2-(6)+1)+(6));
                    y_axis_variable_for_wave2= Math.floor(Math.random()*(0-(3)+1)+(3));
    
                    //Increment X-axis for showing in reverse order wave
                    x_axis.min=x_axis.min+2
                    x_axis.max=x_axis.max+2
    
                    //Join Two points at Runtime
                    l1.append(x_axis_variable_for_wave_1,y_axis_variable_for_wave1)
                    l2.append(x_axis_variable_for_wave_1,y_axis_variable_for_wave2)
    
                    //Increment variable for plotting on next x axis point
                    x_axis_variable_for_wave_1=x_axis_variable_for_wave_1+2
                }
            }
        }
    }
    
    Bhushan_SureB ODБOïO 2 Replies Last reply
    0
    • Bhushan_SureB Bhushan_Sure

      The right side border of chartview shift's little towards left side after completion of one wave, what i am doing wrong ?
      @J-Hilk @LeLev @Yunus @dheerendra

      Rectangle
      {
          id: top
          color: "black"
          visible: true
          width: 400
          height: 250
          focus: true
          clip: true
      
          function graph_1_scaling()
          {
              console.log("Graph1")
              x_axis.min=x_axis.max-80
          }
      
          //Variables and Array
          property double x_axis_variable_for_wave_1:52
          property double y_axis_variable_for_wave1
          property double y_axis_variable_for_wave2
          property variant items: []
          property int  i:0
      
          // ChartView 1
          ChartView
          {
              id:chrt
              height: parent.height
              width: parent.width+51
              x:-31
              antialiasing: true
              legend.visible: false
              backgroundRoundness: 0
              margins.top: 17
              margins.bottom: 0
              margins.left: 1
              margins.right: 1
              backgroundColor: "black"
      
              ValueAxis
              {
                  id:x_axis
                  min: 0
                  max: 50
                  tickCount: 5
                  labelsVisible: false
                  gridLineColor: "#969FB2"
                  color: "#969FB2"
              }
      
              ValueAxis
              {
                  id:y_axis
                  min: 0
                  max: 5
                  tickCount: 4
                  labelsVisible: false
                  gridLineColor: "#969FB2"
                  color: "#969FB2"
      
              }
      
              ValueAxis
              {
                  id:y_axis_right
                  min: 0
                  max: 5
                  tickCount: 6
                  labelsVisible: false
                  gridLineColor: "#969FB2"
                  color: "#969FB2"
              }
      
              LineSeries
              {
                  id:l1
                  axisX: x_axis
                  axisY: y_axis
                  color: "yellow"
              }
      
              LineSeries
              {
                  id:l2
                  axisX: x_axis
                  axisY: y_axis
                  color: "Yellow"
                  style: Qt.DotLine
              }
      
              Timer
              {
                  interval: 1000; repeat: true; running: true
                  onTriggered:
                  {
                      //Creating Random Y-axis variable for wave 1
                      y_axis_variable_for_wave1= Math.floor(Math.random()*(2-(6)+1)+(6));
                      y_axis_variable_for_wave2= Math.floor(Math.random()*(0-(3)+1)+(3));
      
                      //Increment X-axis for showing in reverse order wave
                      x_axis.min=x_axis.min+2
                      x_axis.max=x_axis.max+2
      
                      //Join Two points at Runtime
                      l1.append(x_axis_variable_for_wave_1,y_axis_variable_for_wave1)
                      l2.append(x_axis_variable_for_wave_1,y_axis_variable_for_wave2)
      
                      //Increment variable for plotting on next x axis point
                      x_axis_variable_for_wave_1=x_axis_variable_for_wave_1+2
                  }
              }
          }
      }
      
      Bhushan_SureB Offline
      Bhushan_SureB Offline
      Bhushan_Sure
      wrote on last edited by
      #2

      @LeLev @J-Hilk @dheerendra

      0_1550472980883_Capture1.PNG

      0_1550472983737_Capture2.PNG

      As you can see, at right border it got shifted after some time.

      1 Reply Last reply
      0
      • Bhushan_SureB Bhushan_Sure

        The right side border of chartview shift's little towards left side after completion of one wave, what i am doing wrong ?
        @J-Hilk @LeLev @Yunus @dheerendra

        Rectangle
        {
            id: top
            color: "black"
            visible: true
            width: 400
            height: 250
            focus: true
            clip: true
        
            function graph_1_scaling()
            {
                console.log("Graph1")
                x_axis.min=x_axis.max-80
            }
        
            //Variables and Array
            property double x_axis_variable_for_wave_1:52
            property double y_axis_variable_for_wave1
            property double y_axis_variable_for_wave2
            property variant items: []
            property int  i:0
        
            // ChartView 1
            ChartView
            {
                id:chrt
                height: parent.height
                width: parent.width+51
                x:-31
                antialiasing: true
                legend.visible: false
                backgroundRoundness: 0
                margins.top: 17
                margins.bottom: 0
                margins.left: 1
                margins.right: 1
                backgroundColor: "black"
        
                ValueAxis
                {
                    id:x_axis
                    min: 0
                    max: 50
                    tickCount: 5
                    labelsVisible: false
                    gridLineColor: "#969FB2"
                    color: "#969FB2"
                }
        
                ValueAxis
                {
                    id:y_axis
                    min: 0
                    max: 5
                    tickCount: 4
                    labelsVisible: false
                    gridLineColor: "#969FB2"
                    color: "#969FB2"
        
                }
        
                ValueAxis
                {
                    id:y_axis_right
                    min: 0
                    max: 5
                    tickCount: 6
                    labelsVisible: false
                    gridLineColor: "#969FB2"
                    color: "#969FB2"
                }
        
                LineSeries
                {
                    id:l1
                    axisX: x_axis
                    axisY: y_axis
                    color: "yellow"
                }
        
                LineSeries
                {
                    id:l2
                    axisX: x_axis
                    axisY: y_axis
                    color: "Yellow"
                    style: Qt.DotLine
                }
        
                Timer
                {
                    interval: 1000; repeat: true; running: true
                    onTriggered:
                    {
                        //Creating Random Y-axis variable for wave 1
                        y_axis_variable_for_wave1= Math.floor(Math.random()*(2-(6)+1)+(6));
                        y_axis_variable_for_wave2= Math.floor(Math.random()*(0-(3)+1)+(3));
        
                        //Increment X-axis for showing in reverse order wave
                        x_axis.min=x_axis.min+2
                        x_axis.max=x_axis.max+2
        
                        //Join Two points at Runtime
                        l1.append(x_axis_variable_for_wave_1,y_axis_variable_for_wave1)
                        l2.append(x_axis_variable_for_wave_1,y_axis_variable_for_wave2)
        
                        //Increment variable for plotting on next x axis point
                        x_axis_variable_for_wave_1=x_axis_variable_for_wave_1+2
                    }
                }
            }
        }
        
        ODБOïO Offline
        ODБOïO Offline
        ODБOï
        wrote on last edited by ODБOï
        #3

        hi
        @Bhushan_Sure said

        completion

        you have a infinite timer, how you stop it ?

        Bhushan_SureB 1 Reply Last reply
        1
        • ODБOïO ODБOï

          hi
          @Bhushan_Sure said

          completion

          you have a infinite timer, how you stop it ?

          Bhushan_SureB Offline
          Bhushan_SureB Offline
          Bhushan_Sure
          wrote on last edited by
          #4

          @LeLev It is infinite loop, it should run continously and should take value and plot it in graph.

          ODБOïO 1 Reply Last reply
          0
          • Bhushan_SureB Bhushan_Sure

            @LeLev It is infinite loop, it should run continously and should take value and plot it in graph.

            ODБOïO Offline
            ODБOïO Offline
            ODБOï
            wrote on last edited by ODБOï
            #5

            @Bhushan_Sure yes, but you said : "after completion of one wave" this means you will manually stop the timer right ?

            Bhushan_SureB 2 Replies Last reply
            1
            • ODБOïO ODБOï

              @Bhushan_Sure yes, but you said : "after completion of one wave" this means you will manually stop the timer right ?

              Bhushan_SureB Offline
              Bhushan_SureB Offline
              Bhushan_Sure
              wrote on last edited by
              #6

              @LeLev after completion of one wave means, as the wave starts from right border and ends at left border, as it reaches to left border the position changed only once, then it will remain at that position.

              1 Reply Last reply
              0
              • ODБOïO ODБOï

                @Bhushan_Sure yes, but you said : "after completion of one wave" this means you will manually stop the timer right ?

                Bhushan_SureB Offline
                Bhushan_SureB Offline
                Bhushan_Sure
                wrote on last edited by
                #7

                @LeLev the wave is not completing, actually i want to say that once the wave comes close to left border of chartview then the right border of chartview shift's by little !

                1 Reply Last reply
                0
                • ODБOïO Offline
                  ODБOïO Offline
                  ODБOï
                  wrote on last edited by
                  #8

                  yes i tested it.. that is wierd i have no idea why this is happening sorry

                  Bhushan_SureB 2 Replies Last reply
                  0
                  • ODБOïO ODБOï

                    yes i tested it.. that is wierd i have no idea why this is happening sorry

                    Bhushan_SureB Offline
                    Bhushan_SureB Offline
                    Bhushan_Sure
                    wrote on last edited by
                    #9

                    @LeLev it's okay, i will try some other way :), Thank you for your help

                    1 Reply Last reply
                    0
                    • ODБOïO ODБOï

                      yes i tested it.. that is wierd i have no idea why this is happening sorry

                      Bhushan_SureB Offline
                      Bhushan_SureB Offline
                      Bhushan_Sure
                      wrote on last edited by
                      #10

                      @LeLev
                      Chartview's grid reposition itself everytime whenever min or max of Valueaxis changes. Whenever Valueaxis min or max changes in order of log10 then it reposition it's grid.

                      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