이 페이지에서

Legend QML Type

차트의 범례를 표시합니다. 더 보기...

Import Statement: import QtCharts 2.12
In C++: QLegend
Status: Deprecated

이 유형은 더 이상 권장되지 않습니다. 새로운 코드에서는 이 유형을 사용하지 않는 것을 강력히 권장합니다.

속성

상세 설명

범례(legend)는 차트의 범례를 표시하는 그래픽 객체입니다. 시리즈가 변경되면 ` 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.