PieSeries QML Type
데이터를 원형 그래프로 표시합니다. 더 보기...
Import Statement: | import QtGraphs |
In C++: | QPieSeries |
Inherits: |
- 상속된 멤버를 포함한 모든 멤버 목록
- 파이 시리즈는 Qt Graphs 2D용 QML 유형에 속합니다.
속성
- count : int
- endAngle : real
- holeSize : real
- horizontalPosition : real
- pieSize : real
- startAngle : real
- sum : real
- verticalPosition : real
신호
- added(list<PieSlice> slices)
- countChanged()
- endAngleChanged()
- holeSizeChanged()
- horizontalPositionChanged()
- pieSizeChanged()
- removed(list<PieSlice> slices)
- startAngleChanged()
- sumChanged()
- verticalPositionChanged()
방법
- PieSlice append(string label, real value)
- PieSlice at(int index)
- clear()
- PieSlice find(string label)
- bool remove(PieSlice slice)
- bool remove(int index)
- void removeMultiple(int index, int count)
- bool replace(list<PieSlice> slices)
- bool replace(PieSlice oldSlice, PieSlice newSlice)
- bool replace(int index, PieSlice slice)
- bool take(PieSlice slice)
상세 설명
파이 시리즈는 PieSlice 유형을 사용하여 정의된 슬라이스로 구성됩니다. 파이 시리즈 유형은 그래프에서 슬라이스의 실제 크기를 결정하기 위해 시리즈의 모든 슬라이스의 합과 비교하여 슬라이스의 비율을 계산하므로 슬라이스는 어떤 값이든 가질 수 있습니다.
그래프에서 파이 크기와 위치는 0.0에서 1.0 범위의 상대값을 사용하여 제어합니다. 이는 실제 그래프 사각형과 관련이 있습니다.
기본적으로 파이는 전체 파이로 정의됩니다. 계열의 시작 각도와 각도 범위를 설정하여 부분 파이를 만들 수 있습니다. 전체 파이는 360도이며, 여기서 0은 12시 방향입니다.
다음 QML 예제는 간단한 파이 그래프를 만드는 방법을 보여줍니다.
import QtQuick import QtGraphs Item { id: mainView width: 1280 height: 720 GraphsView { anchors.fill: parent theme: GraphsTheme { colorScheme: GraphsTheme.ColorScheme.Dark theme: GraphsTheme.Theme.QtGreen } PieSeries { id: pieSeries PieSlice { value: 1 } PieSlice { value: 2 } } } }
PieSlice 및 GraphsView 을참조하세요 .
속성 문서
count : int |
계열의 슬라이스 수입니다.
endAngle : real |
파이의 끝 각도입니다.
전체 파이는 360도이며, 여기서 0도는 12시 방향입니다.
기본값은 360입니다.
holeSize : real |
horizontalPosition : real |
파이의 가로 위치.
이 값은 그래프 직사각형에 상대적인 값입니다:
- 0.0은 절대 왼쪽입니다.
- 1.0은 절대 오른쪽입니다.
기본값은 0.5(가운데)입니다.
verticalPosition 를참조하십시오 .
pieSize : real |
파이 크기.
이 값은 그래프 직사각형에 상대적인 값입니다:
- 0.0은 최소 pieSize(파이가 그려지지 않음)입니다.
- 1.0은 그래프에 맞출 수 있는 최대 pieSize입니다.
이 속성을 설정할 때 필요한 경우 holeSize 속성을 조정하여 구멍 크기가 파이 크기보다 크지 않도록 합니다.
기본값은 0.7입니다.
startAngle : real |
파이의 시작 각도입니다.
전체 파이는 360도이며 0도는 12시 방향입니다.
기본값은 0입니다.
sum : real |
모든 슬라이스의 합계입니다.
이 계열은 보유하고 있는 모든 슬라이스의 합계를 추적합니다.
verticalPosition : real |
파이의 수직 위치입니다.
이 값은 그래프 직사각형에 상대적인 값입니다:
- 0.0은 절대 상단입니다.
- 1.0은 절대 하단입니다.
기본값은 0.5(가운데)입니다.
horizontalPosition 를참조하세요 .
신호 문서
countChanged() |
endAngleChanged() |
holeSizeChanged() |
horizontalPositionChanged() |
pieSizeChanged() |
이 신호는 slices 에 지정된 슬라이스가 시리즈에서 제거될 때 발생합니다.
참고: 해당 핸들러는 onRemoved
입니다.
startAngleChanged() |
sumChanged() |
verticalPositionChanged() |
메서드 문서
clear() |
파이에서 모든 슬라이스를 제거합니다.
index 및 count 에 지정된 범위의 슬라이스를 제거합니다. 한 슬라이스를 제거하지 못하더라도 호출은 모든 슬라이스를 순회합니다.
현재 모든 슬라이스를 slices 로 완전히 바꿉니다. 크기가 일치할 필요는 없습니다. slices 의 PieSlice 중 하나라도 유효하지 않은 경우 false를 반환합니다.
oldSlice 에 지정된 슬라이스를 newSlice로 바꿉니다. 제거에 성공하면 true
, 그렇지 않으면 false
을 반환합니다. oldSlice 이 성공하면 삭제됩니다.
index 의 파이에서 slice 에 지정된 슬라이스를 대체합니다. 교체에 성공하면 true
을 반환하고, 그렇지 않으면 false
을 반환합니다.
© 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.