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. Formatting axisX of box plot as date time type
Forum Updated to NodeBB v4.3 + New Features

Formatting axisX of box plot as date time type

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 2 Posters 738 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.
  • V Offline
    V Offline
    vorlket
    wrote on 18 Oct 2016, 05:12 last edited by
    #1

    followed the example http://doc.qt.io/qt-5/qtcharts-boxplotchart-example.html, to generate box plot and trying to figure out how to add date time axisX.

    1 Reply Last reply
    0
    • V Offline
      V Offline
      VRonin
      wrote on 18 Oct 2016, 18:21 last edited by
      #2

      you can use http://doc.qt.io/qt-5/qdatetimeaxis.html

      QDateTimeAxis *axisX = new QDateTimeAxis;
      axisX->setFormat("dd-MM-yyyy");
      chart->setAxisX(axisX, boxWhiskSeries);
      

      "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
      ~Napoleon Bonaparte

      On a crusade to banish setIndexWidget() from the holy land of Qt

      1 Reply Last reply
      1
      • V Offline
        V Offline
        vorlket
        wrote on 19 Oct 2016, 00:16 last edited by vorlket
        #3

        Yep. How do you append x axis values to the QBoxSet / QBoxPlotSeries though? I don't see it in the example (http://doc.qt.io/qt-5/qtcharts-boxplotchart-example.html). I should retitle the question as adding and formatting.

        1 Reply Last reply
        0
        • V Offline
          V Offline
          vorlket
          wrote on 19 Oct 2016, 06:41 last edited by
          #4

          It seems I have to use QBarCategoryAxis, which doesn't have setFormat method. The underlying data is box and whiskers time series, so it's a bit unnatural to convert datetime value to category string for display. Wonder if there's a better workaround.

          1 Reply Last reply
          0

          1/4

          18 Oct 2016, 05:12

          • 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