Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
QLineSeries OpenGL issue
xcoder last edited by
I've been playing around with QtCharts. Thought I would convert one of my application which uses qwt to QtCharts. Unfortunatelly I'm running into some issues.
I'm not able to generate a line chart with large X values when setUseOpenGL is enabled.
Here is a code which doesn't render anything.
QLineSeries *series = new QLineSeries(); series->append(1490215139925, 0.841470985); series->append(1490215157925, 0.14987721); series->append(1490215158925, 0.912945251); series->append(1490215159925, 0.836655639); series->append(1490215160925, -0.008851309); series->setUseOpenGL(true); chart = new QChart(); chart->setTitle( ui->titleEdit->text() ); QFont tFont = chart->titleFont(); tFont.setPointSizeF( 15 ); tFont.setBold( true ); chart->setTitleFont( tFont ); axisX = new QValueAxis; axisX->setRange( (qreal)1490215139925, (qreal)1490215163925 ); axisX->setTickCount(10); axisX->setLabelFormat("%l"); axisX->setTitleText("unixTime"); axisY = new QValueAxis; axisY->setRange(-1, 1); axisY->setTitleText("Level"); chart->setAxisX(dateAxisX); chart->setAxisY(axisY); chart->addSeries(series); series->attachAxis(axisX); series->attachAxis(axisY);
As I mentioned before change setUseOpenGL to false
And all works fine.
Couple other things I tried or noticed:
- If x values are in 32 bit range it seems to work fine in opengl mode
- Tried changing QValueAxis to QDateTimeAxis still doesn't work in opengl mode
Any ideas is it a bug? Is there a workaround? Is this a limitation of OpenGL not able to take in large numbers?
I'm using Qt 5.8 with MinGW 5.3.0 32bit
I'd go check the bug report system to see if there's something related.
xcoder last edited by xcoder
Thanks for your reply, it seems there is no bug reported regarding this issue. Only similar one is that QLineSeries can't be hidden when openGL is enabled.
I'll write an example test code and submit a bug