Chart not updating
Solved
General and Desktop
-
I have a qchart
chart = new QChart(); series->append(QDateTime::currentDateTime().toMSecsSinceEpoch(), 20.00); series->append(QDateTime::currentDateTime().toMSecsSinceEpoch() + 900, 25.00); chart->addSeries(series); chart->setTitle("Tempature since 0:00"); axisX = new QDateTimeAxis; axisX->setTickCount(10); axisX->setFormat("hh:mm:ss"); axisX->setTitleText("Time"); chart->addAxis(axisX, Qt::AlignBottom); series->attachAxis(axisX); axisY = new QValueAxis; axisY->setLabelFormat("%i"); axisY->setTitleText("Tempature"); chart->addAxis(axisY, Qt::AlignLeft); series->attachAxis(axisY); chartView = new QChartView(chart); chartView->setRenderHint(QPainter::Antialiasing);
which i want to update in a timeout fuction for a timer the thing is it is not updating after appending series i can make it update the chart it self by removeing and adding the series but this does not update the axis how do i do this
-
I have a qchart
chart = new QChart(); series->append(QDateTime::currentDateTime().toMSecsSinceEpoch(), 20.00); series->append(QDateTime::currentDateTime().toMSecsSinceEpoch() + 900, 25.00); chart->addSeries(series); chart->setTitle("Tempature since 0:00"); axisX = new QDateTimeAxis; axisX->setTickCount(10); axisX->setFormat("hh:mm:ss"); axisX->setTitleText("Time"); chart->addAxis(axisX, Qt::AlignBottom); series->attachAxis(axisX); axisY = new QValueAxis; axisY->setLabelFormat("%i"); axisY->setTitleText("Tempature"); chart->addAxis(axisY, Qt::AlignLeft); series->attachAxis(axisY); chartView = new QChartView(chart); chartView->setRenderHint(QPainter::Antialiasing);
which i want to update in a timeout fuction for a timer the thing is it is not updating after appending series i can make it update the chart it self by removeing and adding the series but this does not update the axis how do i do this