このページでは

ScatterSeries QML Type

ScatterSeries 型は、データを散布図で表示します。詳細...

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

XYSeries

プロパティ

詳細説明

散布図のデータは、グラフ上の点の集合として表示されます。各点について、横軸と縦軸上の位置を決定する2つの値が指定されます。

グリッド上にデータ点が配置された散布図

GraphsView 内にScatterSeriesを作成することで、散布図データを表現できます。各点のx座標とy座標を定義するXYPointsをScatterSeriesの子要素として作成することで、データをグラフに追加できます。

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

GraphsView の子要素として複数のScatterSeriesを追加することで、複数の散布図を作成できます。この場合、使用する軸を定義するシリーズは1つだけにしてください。複数の定義がある場合、以前の定義が上書きされてしまいます。

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

プロパティのドキュメント

pointDelegate : Component

指定されたQMLコンポーネントでポイントをマークします。

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.