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. Can I change the axis range of the QChart
Qt 6.11 is out! See what's new in the release blog

Can I change the axis range of the QChart

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 8.5k 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.
  • unionRdU Offline
    unionRdU Offline
    unionRd
    wrote on last edited by
    #1
    QValueAxis *axisX = new QValueAxis;
    axisX->setRange(0, 8000);
    axisX->setLabelFormat("%g");
    

    I can change the range in the program,Can I change it in the widget in run time?

    Ni.SumiN beeckscheB 2 Replies Last reply
    0
    • unionRdU unionRd
      QValueAxis *axisX = new QValueAxis;
      axisX->setRange(0, 8000);
      axisX->setLabelFormat("%g");
      

      I can change the range in the program,Can I change it in the widget in run time?

      Ni.SumiN Offline
      Ni.SumiN Offline
      Ni.Sumi
      wrote on last edited by Ni.Sumi
      #2

      @unionRd

      Can I change it in the widget in run time?

      Some thing like this, widget some where in GUI and set value there and give it to axis ? then yes, you can change the range in the run time. USe QSpinBox / equivalent widget and pass the vale of the QSpinBox / equivalent widget using the signal and slot.

      http://doc.qt.io/qt-5/qvalueaxis.html#applyNiceNumbers

      1 Reply Last reply
      0
      • unionRdU unionRd
        QValueAxis *axisX = new QValueAxis;
        axisX->setRange(0, 8000);
        axisX->setLabelFormat("%g");
        

        I can change the range in the program,Can I change it in the widget in run time?

        beeckscheB Offline
        beeckscheB Offline
        beecksche
        wrote on last edited by
        #3

        @unionRd

        See the Surface Example under Axis ranges for studying the graph.

        Hope this helps.

        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