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. Plotting using Qwt with time values in the x-axis
Qt 6.11 is out! See what's new in the release blog

Plotting using Qwt with time values in the x-axis

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 1.1k 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.
  • L Offline
    L Offline
    leinad
    wrote on last edited by
    #1

    Hi,

    I have two QVectors where the y-axis has double values, but the x-axis has time values which are specified in HH::MM::SS.xxxxx, where xxxxx is in milliseconds.

    QVector<QString> timeData; //x-axis
    QVector<double> attributeData; //y-axis

    To setup a plot I have the following:
    QwtPlotCurve *curve1 = new QwtPlotCurve( "Curve 1" );

    When assigning setSamples since time is not a double value, any ideas on how to plot by time on the x axis? Of course qwt needs to be able to interpret the time so it can move along the x-axis properly. There must be a way to do it, just kind find any info on it.
    curve1->setSamples(timeData, y-data); //time data is not a double what else can I use?

    Thanks in advance!

    1 Reply Last reply
    0
    • K Offline
      K Offline
      kuzulis
      Qt Champions 2020
      wrote on last edited by
      #2

      As I remember, you need to set the 'date-time' axis class on the X-asis, or to create an own axis-class and then set to X-axis. Please read the Qwt documentation at first. Also you can ask this question on the qtcentre forum, where the author himself answering the questions.

      1 Reply Last reply
      0
      • L Offline
        L Offline
        leinad
        wrote on last edited by
        #3

        Ok, thanks. I'll repost the question so the author can answer it with an example if possible.

        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