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 we set axis range with size of the series?
Forum Updated to NodeBB v4.3 + New Features

Can we set axis range with size of the series?

Scheduled Pinned Locked Moved Unsolved General and Desktop
chartaxisqt5
4 Posts 2 Posters 558 Views 1 Watching
  • 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.
  • D Offline
    D Offline
    deleted286
    wrote on 7 Jan 2021, 14:40 last edited by
    #1

    Is is possible to set axis range like thi? It gives me an error, it says cannot initialize a parameter of type 'qreal' (aka 'double') with an lvalue of type 'QtCharts::QSplineSeries *'

    axisX->setRange(series, series);
    
    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 7 Jan 2021, 14:45 last edited by
      #2

      Hi,

      No you can't. The error you get from the compiler explains exactly why.

      Since you are reading the series value from a text file, you want to check each of them and keep the minimum and maximum value. Then you can use them to set the the axis range.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      D 1 Reply Last reply 7 Jan 2021, 14:47
      1
      • S SGaist
        7 Jan 2021, 14:45

        Hi,

        No you can't. The error you get from the compiler explains exactly why.

        Since you are reading the series value from a text file, you want to check each of them and keep the minimum and maximum value. Then you can use them to set the the axis range.

        D Offline
        D Offline
        deleted286
        wrote on 7 Jan 2021, 14:47 last edited by
        #3

        @SGaist I'll try. Where should i check min and max value ?

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 7 Jan 2021, 14:51 last edited by
          #4

          In the loop you use to read your file.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0

          1/4

          7 Jan 2021, 14:40

          • Login

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