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. Chart scroll
Forum Updated to NodeBB v4.3 + New Features

Chart scroll

Scheduled Pinned Locked Moved Solved QML and Qt Quick
3 Posts 2 Posters 514 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.
  • ODБOïO Offline
    ODБOïO Offline
    ODБOï
    wrote on last edited by
    #1

    Hi, i have this chartView

     ChartView {
            id:mchart
              width: parent.width / 2
            height: parent.height
            LineSeries{
                id:vals
            }
        }
    

    Im adding appending points to it whan a signal 'onMessageChanged' is emitted

      onMessageChanged: {
            var messageFields = inspector.logMsg.split(";")
             vals.append(tick , messageFields[1] );
             tick+=0.2 // this is the time x axis
                if(tick>1)
                    mchart.scrollRight(/**/)
        }
    

    My question is : How much i have to scroll right to ensure that last added point is visible ?

    mchart.scrollRight(/* x ?*/)
    

    or is there a methode like positionViewAtEnd() that i can directly use ?

    Thx in advance

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

      Hi, i have this chartView

       ChartView {
              id:mchart
                width: parent.width / 2
              height: parent.height
              LineSeries{
                  id:vals
              }
          }
      

      Im adding appending points to it whan a signal 'onMessageChanged' is emitted

        onMessageChanged: {
              var messageFields = inspector.logMsg.split(";")
               vals.append(tick , messageFields[1] );
               tick+=0.2 // this is the time x axis
                  if(tick>1)
                      mchart.scrollRight(/**/)
          }
      

      My question is : How much i have to scroll right to ensure that last added point is visible ?

      mchart.scrollRight(/* x ?*/)
      

      or is there a methode like positionViewAtEnd() that i can directly use ?

      Thx in advance

      DiracsbracketD Offline
      DiracsbracketD Offline
      Diracsbracket
      wrote on last edited by Diracsbracket
      #2

      @LeLev
      I have never used scrollRight (wasn't even aware there was such a method), but wouldn't it be easier to just adapt the range of your XAxis such that its max main tick value is greater than or equal to the x-coordinate of the new point?

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

        @Diracsbracket thank you for the suggestion i will try today.

        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