En esta página

ScatterSeries QML Type

El tipo ScatterSeries presenta datos en gráficos de dispersión. Más...

Import Statement: import QtGraphs
In C++: QScatterSeries
Inherits:

XYSeries

Propiedades

Descripción detallada

Los datos de dispersión se muestran como una colección de puntos en el gráfico. Para cada punto, se especifican dos valores que determinan su posición en el eje horizontal y en el eje vertical.

Los datos de dispersión se pueden representar creando una ScatterSeries dentro de GraphsView. Los datos pueden añadirse al gráfico creando XYPoints como hijos de la ScatterSeries que definen los valores x e y de cada 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 }
    }
}

Se pueden crear múltiples gráficos de dispersión añadiendo múltiples ScatterSeries como hijos de GraphsView. En estos casos sólo una serie debe definir el eje utilizado ya que múltiples definiciones sólo anulan las anteriores.

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 }
    }
}

Documentación de propiedades

pointDelegate : Component

Marca puntos con el componente QML dado.

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.