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. Visualize value on Qt Chart View
Forum Update on Tuesday, May 27th 2025

Visualize value on Qt Chart View

Scheduled Pinned Locked Moved Unsolved General and Desktop
qtcharts
4 Posts 2 Posters 9.4k 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.
  • V Offline
    V Offline
    ValentinMichelet
    wrote on 26 Jul 2016, 09:11 last edited by
    #1

    Hi everyone,

    So I've been playing around with Qt Charts now that it's available under GPLv3, and I got some trouble displaying data.

    I'm using a QBarSeries to create a bar chart that displays some amount. Everything is fine, but the data visualization is kind of lightweight. I'd like to display the real amount of a bar, say in a tooltip when hovering the bar at least.

    For the moment, There are only 3 or 4 values on the y-axis, but there is no way to know precisely the real value of each bar.

    Am I missing something in the documentation? Do I have to implement it myself ? If so, what do I have to subclass: QChart, QChartView, QLegend, QBarSeries?

    1 Reply Last reply
    0
    • V Offline
      V Offline
      VRonin
      wrote on 26 Jul 2016, 09:23 last edited by
      #2

      See the callout example: http://doc.qt.io/qt-5/qtcharts-callout-example.html

      "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
      2
      • V Offline
        V Offline
        ValentinMichelet
        wrote on 26 Jul 2016, 09:31 last edited by
        #3

        I missed that example, thanks a lot @VRonin!

        So yeah, I have to subclass a view and do the tooltip like display myself using mapToValue, as I suspected.

        I won't close this post yet, just in case someone else has something to add.

        1 Reply Last reply
        0
        • V Offline
          V Offline
          ValentinMichelet
          wrote on 27 Jul 2016, 08:46 last edited by
          #4

          OK so this example is about QLineSeries, not QBarSeries, and there is a reason: QLineSeries has clicked(QPointF) and hovered(QPointF, bool) signals, QBarSeries doesn't.

          So I think I'll have to simply implement a BarView that displays the value, using QGraphics framework.

          1 Reply Last reply
          0

          1/4

          26 Jul 2016, 09:11

          • 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