QCharts look different when using setUseOpenGL(true)

  • I'm trying to generate plots using a QChart with a QLineSeries. When I don't have OpenGL enabled, the plot is smooth and shows every detail. When I set it to true, looks very decimated. And the few points that do exist have the following pattern: there is a vertical line and then a diagonal line from that to another vertical line. Here is with no OpenGL.0_1473707761884_NoOpenGL.png

    Here is with OpenGL.


    All the rest of the code is identical. I just call setUseOpenGL(true) for the second. I'm running this on an Ubuntu 16.04.1 Virtual machine in VMWare Player.

    Thank you for any help and support.

  • Qt Champions 2017

    Upload images is currently broken so even you see them, others cannot.
    Its better to use external site and link here.
    Sorry for the inconvenience.

  • OK. Here are some Imgur links.

    Without OpenGL: alt text

    With OpenGL: alt text

  • I ran into exactly this same problem. It's caused by the GLWidget class using floating point precision, y values are fine, but your x values are greater than max float. What you could do is rebase your timestamps by subtracting the min timestamp from your series.

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.