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. Is it possible to display the value of a QLineSeries point in a QChart?
Forum Updated to NodeBB v4.3 + New Features

Is it possible to display the value of a QLineSeries point in a QChart?

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 291 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.
  • D Offline
    D Offline
    diego-qt
    wrote on last edited by
    #1

    Hello, I would like to create a chart where the user is able to read to value of every point of a chart by passing the mouse over it.
    I found this piece of code that I tried to modify: https://stackoverflow.com/a/41346349 but the problem is that it shows the value where the mouse stands whenever it is inside the chart, whereas I would like it to only show the value of a point in the line series attached to the chart.

    I don't know if this is possible. I have the impression that the chart becomes an image and it is not possible to retreat information of the line series points.

    Considering there is only one line series in a chart, I thought about finding the value in the chart pointed by the mouse with QChart::mapToValue and use the x value to find the closest line series point in the horizontal axe within (let's say) 3 pixels. The problem is that I haven't found a QChart function that returns that. One option would be to retrieve the entire line series with QChart::series and search for it, but if the series is too long (like hundred-of-items long) it may become difficult to show the value in real time.

    Anyone has any ideas?

    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