一、效果图
Qt QtDataVisualization Q3DScatter绘制散点图_类对象
二、代码

 1     //创建Q3DScatter三维散点图类对象
 2     QtDataVisualization::Q3DScatter scatter;
 3     scatter.setFlags(scatter.flags() ^ Qt::FramelessWindowHint);
 4     //新建序列和数据,在序列中加入3个点,把序列添加到图形
 5     QtDataVisualization::QScatter3DSeries *series = new QtDataVisualization::QScatter3DSeries;
 6     QtDataVisualization::QScatterDataArray data;
 7     data << QVector3D(0.5f, 0.5f, 0.5f) << QVector3D(-0.3f, -0.5f, -0.4f) << QVector3D(0.0f, -0.3f, 0.2f);
 8     series->dataProxy()->addItems(data);
 9     scatter.addSeries(series);
10     scatter.show();