Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

The Axis do not match with the serie



  • Hi every Qt collage! I hope all be fine!

    Ok, I have a problem. I trying to plot a data (no important date: the data come from Arduino), and all is fine but, the the axis values do not math whit the series values.

    I tried some possibility.
    1.

    lineserie->append(count, value_a);
    chart->removeSeries(lineserie);       //to remove the before serie and add the new one
    chart->addSeries(lineserie);
    chart->addAxis(axisX, Qt::AlignBottom);
    chart->addAxis(axisY, Qt::AlignLeft);
    lineserie->attachAxis(axisX);
    lineserie->attachAxis(axisY);
    

    Should be work I think... using the attachAxis() function, I suppose that the axes refresh it sealf and/or the line inside the chart. But that do not happen!!!

    Screenshot_2020-04-02_23-08-52.png

    1. In the second try I refresh manually the values of the
      where count is the current data received ... I put tha range 10:34 (temperature)
    lineserie->append(count, value_a);
    chart->removeSeries(lineserie);         //to remove the before serie and add the new one
    axisX->setRange(0, count);
    axisY->setRange(10,34);
    chart->addSeries(lineserie);
    

    Screenshot_2020-04-02_23-10-13.png
    As you can see, there is a "non-connection" of the serie whit the axes and/or vie versa.

    The best.
    Al


Log in to reply