PolarChartView QML Type

データを極座標で表示する。詳細...

Import Statement: import QtCharts 2.8
Inherits:

ChartView

詳細説明

極座標は円形のグラフでデータを示し、データの配置はグラフの中心である極からの角度と距離に基づいている。

極線グラフは、ChartView タイプの特殊化です。折れ線、スプライン、面積、散布の各系列と、それらでサポートされているすべての軸タイプをサポートしている。各軸は、半径軸としても角度軸としても使用できる。

角度軸ValueAxis の最初と最後の目盛りは、0/360度の角度で同じ位置にある。

連続する2点間の角度距離が180度以上の場合、その2点を結ぶ直線は意味をなさなくなり、引かれなくなる。その代わり、チャートの中心を往復する線が引かれる。したがって、折れ線、スプライン、面積の系列を表示するときは、軸の範囲を適宜選択しなければならない。

ポーラー・チャートは、同じ向きの軸をすべて同じ位置に描くので、グリッドをカスタマイズするためだけに余分な軸を使うのでなければ、同じ向きの軸を複数使うと混乱することがある。たとえば、強調表示された範囲を二次的な陰影のあるCategoryAxis 、ラベルのない小目盛りを、ラベルが隠されている二次的なValueAxis

次のQMLコードは、スプラインと散布図系列と2つの値軸を持つ極座標チャートを作成する方法を示しています:

PolarChartView {
    title: "Two Series, Common Axes"
    anchors.fill: parent
    legend.visible: false
    antialiasing: true

    ValueAxis {
        id: axisAngular
        min: 0
        max: 20
        tickCount: 9
    }

    ValueAxis {
        id: axisRadial
        min: -0.5
        max: 1.5
    }

    SplineSeries {
        id: series1
        axisAngular: axisAngular
        axisRadial: axisRadial
        pointsVisible: true
    }

    ScatterSeries {
        id: series2
        axisAngular: axisAngular
        axisRadial: axisRadial
        markerSize: 10
    }

    // Add data dynamically to the series
    Component.onCompleted: {
        for (var i = 0; i <= 20; i++) {
            series1.append(i, Math.random());
            series2.append(i, Math.random());
        }
    }
}

© 2025 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.