Legend QML Type
チャートの凡例を表示します。詳細...
| Import Statement: | import QtCharts 2.12 |
| In C++: | QLegend |
| Status: | Deprecated |
この型は非推奨です。新しいコードでの使用は強くお勧めしません。
プロパティ
- alignment : alignment
- backgroundVisible : bool
- borderColor : color
- color : color
- font : Font
- labelColor : color
- markerShape : enumeration
- reverseMarkers : bool
- showToolTips : bool
- visible : bool
詳細説明
凡例は、チャートの凡例を表示するグラフィックオブジェクトです。凡例の状態は、シリーズが変更された際に `ChartView ` タイプによって更新されます。`Legend ` タイプのプロパティは、`ChartView ` タイプに割り当てることができます。例:
ChartView {
legend.visible: true
legend.alignment: Qt.AlignBottom
// Add a few series...
}
注: 凡例マーカーを変更するためのQML APIは用意されていません 。マーカーを変更するには、カスタム凡例を作成する必要があります。詳細については、「凡例マーカーの使用」を参照してください。
プロパティのドキュメント
alignment : alignment
凡例をグラフに対してどのように配置するかを指定します。Qt.AlignLeft 、Qt.AlignRight 、Qt.AlignBottom 、またはQt.AlignTop のいずれかを指定できます。複数のフラグを設定した場合、結果は未定義となります。
backgroundVisible : bool
伝説の背景が表示されているかどうか。
borderColor : color
凡例の線の色。
color : color
凡例の背景(ブラシ)色。
font : Font
凡例で使用されているマーカーのフォント。
labelColor : color
ラベルの描画に使用するブラシの色。
markerShape : enumeration
凡例マーカーのデフォルトの形状。デフォルト値はMarkerShapeRectangle です。
| 定数 | 説明 |
|---|---|
Legend.MarkerShapeRectangle | 凡例マーカーは長方形です |
Legend.MarkerShapeCircle | 凡例マーカーは円形です |
MarkerShapeRotatedRectangle | 凡例マーカーは回転した長方形です。 |
MarkerShapeTriangle | 凡例マーカーは三角形です。 |
MarkerShapeStar | 凡例マーカーは星形です。 |
MarkerShapePentagon | 凡例マーカーは五角形です。 |
Legend.MarkerShapeFromSeries | 凡例マーカーの形状は系列によって決まります |
「QLegend::MarkerShape」も参照してください 。
reverseMarkers : bool
凡例のマーカーに逆順を使用するかどうか。このプロパティのデフォルト値はfalse です。
showToolTips : bool
テキストが切り詰められた場合にツールチップを表示するかどうか。このプロパティのデフォルト値は `false ` です。QML では現在ツールチップがサポートされていないため、このプロパティは現在効果を持ちません。
visible : bool
凡例を表示するかどうか。
デフォルトでは、このプロパティは「true 」に設定されています。
「QGraphicsObject::visible」も参照してください 。
© 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.