이 페이지에서

CategoryAxis QML Type

CategoryAxis는 축에 명명된 범위를 배치합니다. 더 보기...

Import Statement: import QtCharts 2.12
In C++: QCategoryAxis
Inherits:

AbstractAxis

Status: Deprecated

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

속성

방법

  • void append(string label, real endValue)
  • void remove(string label)
  • void replace(string oldLabel, string newLabel)

상세 설명

이 유형은 레이블이 지정된 범주를 추가하여 기초 데이터를 설명하는 데 사용할 수 있습니다. 범주 범위의 폭은 자유롭게 지정할 수 있습니다.

예:

‘중요’, ‘낮음’, ‘정상’, ‘높음’, ‘매우 높음’으로 표시된 범주 축이 있는 선 그래프

ChartView {
    title: "Numerical Data for Dummies"
    anchors.fill: parent
    legend.visible: false
    antialiasing: true

    LineSeries {
        axisY: CategoryAxis {
            min: 0
            max: 30
            CategoryRange {
                label: "critical"
                endValue: 2
            }
            CategoryRange {
                label: "low"
                endValue: 4
            }
            CategoryRange {
                label: "normal"
                endValue: 7
            }
            CategoryRange {
                label: "high"
                endValue: 15
            }
            CategoryRange {
                label: "extremely high"
                endValue: 30
            }
        }

        XYPoint { x: 0; y: 4.3 }
        XYPoint { x: 1; y: 4.1 }
        XYPoint { x: 2; y: 4.7 }
        XYPoint { x: 3; y: 3.9 }
        XYPoint { x: 4; y: 5.2 }
    }
}

속성 문서

categoriesLabels : StringList [read-only]

카테고리 레이블은 문자열 목록으로 구성됩니다.

count : int [read-only]

범주의 수.

labelsPosition : enumeration

범주 레이블의 위치. 축의 시작점과 끝점에 위치한 레이블은 ‘값’을 기준으로 배치될 경우 다른 축의 레이블과 겹칠 수 있습니다.

상수설명
CategoryAxis.AxisLabelsPositionCenter라벨은 범주 중앙에 정렬됩니다.
CategoryAxis.AxisLabelsPositionOnValue라벨은 범주의 상한선에 배치됩니다.

startValue : int

축상의 첫 번째 범주의 하한.

메서드 문서

void append(string label, real endValue)

label 라는 레이블을 가진 새로운 범주를 축에 추가합니다. 범주 레이블은 고유해야 합니다. endValue 는 해당 범주의 상한값을 지정합니다. 이 값은 이전 범주의 상한값보다 커야 합니다. 그렇지 않으면 이 메서드는 새로운 범주를 추가하지 않고 반환됩니다.

void remove(string label)

label 라는 레이블로 지정된 범주를 축에서 제거합니다.

void replace(string oldLabel, string newLabel)

oldLabel 로 지정된 기존 카테고리 레이블을 newLabel 로 대체합니다. 기존 레이블이 존재하지 않는 경우, 이 메서드는 아무런 변경도 가하지 않고 반환합니다.

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