Legend QML Type
チャートの凡例を表示する。詳細...
| Import Statement: | import QtCharts 2.11 |
| In C++: | QLegend |
プロパティ
- 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.