ScatterSeries QML Type
Il tipo ScatterSeries presenta i dati sotto forma di grafici a dispersione. Per saperne di più...
| Import Statement: | import QtGraphs |
| In C++: | QScatterSeries |
| Inherits: |
- Elenco di tutti i membri, compresi quelli ereditati
- ScatterSeries fa parte dei tipi QML 2D diQt Graphs .
Proprietà
- pointDelegate : Component
Descrizione dettagliata
I dati del grafico a dispersione vengono visualizzati come un insieme di punti sul grafico. Per ciascun punto vengono specificati due valori che ne determinano la posizione sull'asse orizzontale e sull'asse verticale.

È possibile rappresentare i dati di un grafico a dispersione creando una ScatterSeries all'interno di un GraphsView. I dati possono essere aggiunti al grafico creando oggetti XYPoints come elementi figli della ScatterSeries, che definiscono i valori x e y di ciascun punto.
GraphsView {
anchors.fill: parent
axisX: ValueAxis {
max: 3
}
axisY: ValueAxis {
max: 3
}
ScatterSeries {
color: "#00ff00"
XYPoint { x: 0.5; y: 0.5 }
XYPoint { x: 1; y: 1 }
XYPoint { x: 2; y: 2 }
XYPoint { x: 2.5; y: 1.5 }
}
}È possibile creare più grafici a dispersione aggiungendo più oggetti `ScatterSeries` come elementi figli dell'oggetto ` GraphsView`. In tali casi, solo una serie dovrebbe definire l'asse utilizzato, poiché definizioni multiple sovrascrivono semplicemente quelle precedenti.
GraphsView {
anchors.fill: parent
ScatterSeries {
color: "#00ff00"
axisX: ValueAxis {
max: 3
}
axisY: ValueAxis {
max: 3
}
XYPoint { x: 0.5; y: 0.5 }
XYPoint { x: 1; y: 1 }
XYPoint { x: 2; y: 2 }
XYPoint { x: 2.5; y: 1.5 }
}
ScatterSeries {
color: "#ff0000"
XYPoint { x: 0.5; y: 3 }
XYPoint { x: 1; y: 2 }
XYPoint { x: 2; y: 2.5 }
XYPoint { x: 2.5; y: 1 }
}
}Documentazione delle proprietà
pointDelegate : Component
Indica i punti con il componente QML specificato.
pointDelegate: Image {
source: "images/happy_box.png"
}© 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.