How can I adapt my chart size according to my datas?
-
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
Set 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
@Pl45m4 Can we do it automatically?
-
@Pl45m4 Can we do it automatically?
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:
-
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:
@Pl45m4 Thank you