Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Bar series X axis not represeting decimal values

Bar series X axis not represeting decimal values

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 198 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
    Dudu014
    wrote on last edited by
    #1

    Hi,

    I am trying to use a "BarSeries" object as a Histogram as there is not histogram on the "ChartView" class. Main difference is the x-axis represents a value and not a category.

    Therefore I am using "QValueAxis" instead of "QBarCategoryAxis" to represent the BarSeries x-axis. However when the value on the x-axis is decimal, the data is represented rounded to the closer integer on the visual graph. So if the value is 4.4, this is represented as a 4 in the x-axis.

    For adding the values to the chart I am using the .append() function in this manner:
    mySeries.append("set 1", [Qt.point(5, 0.042735),Qt.point(4.5, 0.042735)])

    Being "mySeries" the id of my "BarSeries" Object.

    Looking on the documentation I found this, which states that if using QValueAxis it will plot the index and not the actual value:
    https://doc.qt.io/qt-6/qabstractbarseries.html#details

    Is there a way of forcing "BarSeries" object to include decimal values instead on the visual representation? Perhaps changing the code of this package might be the only way, but not sure how to access them.

    Thanks in advance.

    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