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. UnMatched QChart YAxis
QtWS25 Last Chance

UnMatched QChart YAxis

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 450 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
    dont do that
    wrote on last edited by dont do that
    #1

    Hi All
    i can't under stand unmatched data

    • chart
      0_1534811707050_chart (2).PNG

    • data
      0_1534810906768_data.PNG

    -sourece code

    d->mChart->removeAllSeries();
    

    QSplineSeries* series = new QSplineSeries();
    this->setXRange(0, grayImg.size().width);
    this->setYRange(0, 285);

    for(int x = 0; x< grayImg.size().width; x++)
    {
            const QPoint point(x, value); // value == 255 / but graph is 285
            series->append(point);
    }
    
    qDebug() << series->pointsVector();
    
    
    d->mChart->addSeries(series);
    

    plz help

    thanks

    jsulmJ 1 Reply Last reply
    0
    • D dont do that

      Hi All
      i can't under stand unmatched data

      • chart
        0_1534811707050_chart (2).PNG

      • data
        0_1534810906768_data.PNG

      -sourece code

      d->mChart->removeAllSeries();
      

      QSplineSeries* series = new QSplineSeries();
      this->setXRange(0, grayImg.size().width);
      this->setYRange(0, 285);

      for(int x = 0; x< grayImg.size().width; x++)
      {
              const QPoint point(x, value); // value == 255 / but graph is 285
              series->append(point);
      }
      
      qDebug() << series->pointsVector();
      
      
      d->mChart->addSeries(series);
      

      plz help

      thanks

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @dont-do-that All your points have y == 255, so you're drawing a horizontal line.

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      D 1 Reply Last reply
      2
      • jsulmJ jsulm

        @dont-do-that All your points have y == 255, so you're drawing a horizontal line.

        D Offline
        D Offline
        dont do that
        wrote on last edited by dont do that
        #3

        @jsulm thx reply but i find answer

        //all charts are need createDefaultAxes Function
        // Document - > The axes specific to the series can be later obtained from the chart by providing the series as the parameter for the axes() function call. QPieSeries does not create any axes.

        d->mChart->removeAllSeries();
        d->mChart->addSeries(series);
        d->mChart->createDefaultAxes(); // always need this function after addSeries

        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