ScatterSeries QML Type
ScatterSeries 类型用于在散点图中呈现数据。更多内容...
| Import Statement: | import QtCharts 2.12 |
| In C++: | QScatterSeries |
| Inherits: | |
| Status: | Deprecated |
此类型已弃用。我们强烈建议不要在新代码中使用它。
属性
- borderColor : color
- borderWidth : real
- brush : brush
- brushFilename : string
- count : int
- markerShape : enumeration
- markerSize : real
详细说明
散点数据在图表上以一组点的形式显示。对于每个点,需指定两个值来确定其在横轴和纵轴上的位置。

以下 QML 代码演示了如何创建一个包含两个简单散点图系列的图表:
ChartView {
title: "Scatter Chart"
anchors.fill: parent
antialiasing: true
ScatterSeries {
id: scatter1
name: "Scatter A"
XYPoint { x: 1.5; y: 1.5 }
XYPoint { x: 1.5; y: 1.6 }
XYPoint { x: 1.57; y: 1.55 }
XYPoint { x: 1.8; y: 1.8 }
XYPoint { x: 1.9; y: 1.6 }
XYPoint { x: 2.1; y: 1.3 }
XYPoint { x: 2.5; y: 2.1 }
}
ScatterSeries {
name: "Scatter B"
XYPoint { x: 2.0; y: 2.0 }
XYPoint { x: 2.0; y: 2.1 }
XYPoint { x: 2.07; y: 2.05 }
XYPoint { x: 2.2; y: 2.9 }
XYPoint { x: 2.4; y: 2.7 }
XYPoint { x: 2.67; y: 2.65 }
}
}有关更多信息,请参阅“使用 QML 图表图库”。
属性文档
borderColor : color
用于绘制标记边框的颜色。
borderWidth : real
边框线的宽度。默认宽度为 2.0。
brush : brush
用于绘制散点序列标记的画笔。
brushFilename : string
该系列中用作画笔的文件名称。
count : int
该序列中的数据点数量。
markerShape : enumeration
渲染标记项时使用的形状:
| 常量 | 描述 |
|---|---|
ScatterSeries.MarkerShapeCircle | 标记为圆形。这是默认值。 |
ScatterSeries.MarkerShapeRectangle | 标记为矩形。 |
markerSize : real
用于渲染该序列中各点的标记大小。
© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.