How can I adapt my chart size according to my datas?
-
wrote on 6 Jan 2021, 14:16 last edited by deleted286 1 Jun 2021, 14:17
I have a scrolling dynamic chart. When the new data come, i cannot see because the chart size. Can i automatize it ? Does qt charts have a property like that?
QChart *chart = new QChart(); chart->addSeries(series); qDebug()<< series; QPen green(Qt::red); green.setWidth(2); series->setPen(green); chart->legend()->hide(); chart->setTitle("deneme"); chart->setAnimationOptions(QChart::AllAnimations); QValueAxis *axisX=new QValueAxis; axisX->setTickCount(10); chart->addAxis(axisX, Qt::AlignBottom); series->attachAxis(axisX); QValueAxis *axisY = new QValueAxis; axisY->setTickCount(5); chart->addAxis(axisY, Qt::AlignLeft); series->attachAxis(axisY); QChartView *chartView = new QChartView(chart); chartView->setRenderHint(QPainter::Antialiasing); this->setCentralWidget(chartView);
There are datas on the right but we cannot see
-
I have a scrolling dynamic chart. When the new data come, i cannot see because the chart size. Can i automatize it ? Does qt charts have a property like that?
QChart *chart = new QChart(); chart->addSeries(series); qDebug()<< series; QPen green(Qt::red); green.setWidth(2); series->setPen(green); chart->legend()->hide(); chart->setTitle("deneme"); chart->setAnimationOptions(QChart::AllAnimations); QValueAxis *axisX=new QValueAxis; axisX->setTickCount(10); chart->addAxis(axisX, Qt::AlignBottom); series->attachAxis(axisX); QValueAxis *axisY = new QValueAxis; axisY->setTickCount(5); chart->addAxis(axisY, Qt::AlignLeft); series->attachAxis(axisY); QChartView *chartView = new QChartView(chart); chartView->setRenderHint(QPainter::Antialiasing); this->setCentralWidget(chartView);
There are datas on the right but we cannot see
wrote on 6 Jan 2021, 16:44 last edited bySet the range of your X-Axis so that your line series fits in completely
-
Set the range of your X-Axis so that your line series fits in completely
wrote on 7 Jan 2021, 05:51 last edited by@Pl45m4 Can we do it automatically?
-
@Pl45m4 Can we do it automatically?
wrote on 7 Jan 2021, 15:16 last edited byI don't know... Can you?! It's your project :)
You know best where you add new data and where you can insert the code to rearrange your axis.Maybe this helps:
-
I don't know... Can you?! It's your project :)
You know best where you add new data and where you can insert the code to rearrange your axis.Maybe this helps:
wrote on 8 Jan 2021, 10:28 last edited by@Pl45m4 Thank you
5/5