Search code examples
c++qtqchart

QChart how to remove white border around the QScatterSeries


Would you have any idea how to remove the white border around the point when QScatterSeries is used? Is it possible?

The idea behind is that when I plot a lot of values (on the image are 100 only) close to each other, the points will become white/disapper because of the borders.

QScatterSeries plot


Solution

  • You need to set a transparent border color via setBorderColor() or a transparent pen color via setPen().

    series->setBorderColor(Qt::transparent);
    

    Or

    series->setPen(QColor(Qt::transparent));
    

    See ScatterChart Example.

    You can also disable QPen drawing line at all using Qt::PenStyle

    series->setPen(QPen(Qt::PenStyle::NoPen));