Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Scroll the axis when program first run

Scroll the axis when program first run

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 139 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.
  • F Offline
    F Offline
    firsnur96
    wrote on last edited by
    #1

    I have written this code for scroll my chart.
    But there is something wrong, when i run my app, it starts with scroll the axis x.
    How can i solve this issue?

    seri[i]->append(q_x, number);
    q_x ++;
    
    if(q_x > 60)
    {
        for(int i=0; i<160; i++)
            axisX->setRange(q_x-60, q_x+1);
    }
    
    if ((q_x % 1000) == 0)
    {
        for (int i=0;i<160; i++)
          seri[i]->removePoints(0,seri[i]->count());
        for (int i=0;i<4; i++)
            axisX->setRange(0, 60);
        say=0;
    }
    
    JonBJ 1 Reply Last reply
    0
    • F firsnur96

      I have written this code for scroll my chart.
      But there is something wrong, when i run my app, it starts with scroll the axis x.
      How can i solve this issue?

      seri[i]->append(q_x, number);
      q_x ++;
      
      if(q_x > 60)
      {
          for(int i=0; i<160; i++)
              axisX->setRange(q_x-60, q_x+1);
      }
      
      if ((q_x % 1000) == 0)
      {
          for (int i=0;i<160; i++)
            seri[i]->removePoints(0,seri[i]->count());
          for (int i=0;i<4; i++)
              axisX->setRange(0, 60);
          say=0;
      }
      
      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by JonB
      #2

      @firsnur96
      I have no idea, but why would you repeatedly set axisX's range to a constant value in any loops?? I don't know what you're trying to do, but how can that be the right thing to do? Purely at a guess, I don't think you are really wanting to do this on a constant axisX variable, or there is no point in having any loop?

      1 Reply Last reply
      1

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved