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. QChart odd Y-Axis default values
Forum Updated to NodeBB v4.3 + New Features

QChart odd Y-Axis default values

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

    Hello all,

    For part of my project on a QChart, I need to also cover rare situations in which all binary data is the same: either 0 or 1

    We add the points to the lienseries "series" as follows and the output is:

    QVector<double> data {1, 1, 1};
    for(int i=0; i<data.size(); i++) {
            QPointF p (i, data[i]);
            *series << p;
        }
    

    1.PNG

    Y values: from 0.5 to 1.5

    And if data is {0, 0, 0}, the output using the above snippet code is:

    2.PNG

    Y values: from -0.5 to 0.5!!

    Why do the values on the y axes change and the resulting line is always on the middle of the chart, please?

    I didn't find any specific clue on the Docs to solve the issue. What I want is when the data is all zero, the line sits on the floor, and on the top when data is all one.

    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