이 페이지에서

BarCategoryAxis QML Type

그래프의 축에 범주를 추가합니다. 더 보기...

Import Statement: import QtGraphs
In C++: QBarCategoryAxis
Inherits:

AbstractAxis

속성

신호

방법

  • void append(list categories)
  • void append(string category)
  • string at(int index)
  • void clear()
  • void insert(int index, string category)
  • void remove(int index)
  • void remove(string category)
  • void replace(string oldCategory, string newCategory)

상세 설명

BarCategoryAxis 유형은 눈금, 격자선 및 음영이 포함된 축선을 표시하도록 설정할 수 있습니다. 범주는 눈금 사이에 그려집니다.

다음 QML 스니펫은 BarCategoryAxis 사용 방법을 보여줍니다:

GraphsView {
    anchors.fill: parent
    axisX: BarCategoryAxis {
        categories: ["2023", "2024", "2025"]
        lineVisible: false
    }
    axisY: ValueAxis { }
    BarSeries {
        BarSet {
            values: [7, 6, 9]
        }
    }
}

속성 설명서

categories : list

축의 범주.

count : int [read-only]

축의 범주 수.

labelPosition : enumeration [since 6.11]

상수설명
BarCategoryAxis.Center라벨은 카테고리 중앙에 정렬됩니다.
BarCategoryAxis.OnValue라벨은 카테고리의 상단 경계선에 배치됩니다.

이 속성은 Qt 6.11에서 도입되었습니다.

max : string

축의 최대값입니다. 지정된 값은 ` categories`에 포함되어야 합니다.

min : string

축의 최소값입니다. 지정된 값은 categories 에 포함되어야 합니다.

신호 설명서

categoriesChanged()

이 신호는 축의 범주가 변경될 때 발생합니다.

참고: 해당 핸들러는 onCategoriesChanged 입니다.

categoryRangeChanged(string min, string max)

이 신호는 축의 범주가 변경될 때 발생합니다. min 및 max 는 새로운 범위의 최소값과 최대값입니다.

참고: 해당 핸들러는 onCategoryRangeChanged 입니다.

countChanged()

이 신호는 축의 범주 수가 변경될 때 발생합니다.

참고: 해당 핸들러는 onCountChanged 입니다.

maxChanged(string max)

이 신호는 축의 최대값이 max 로 변경될 때 발생합니다.

참고: 해당 핸들러는 onMaxChanged 입니다.

minChanged(string min)

이 신호는 축의 최소값이 min 로 변경될 때 발생합니다.

참고: 해당 핸들러는 onMinChanged 입니다.

메서드 문서

void append(list categories)

categories 를 축에 추가합니다. 축의 최대값은 categories 에 있는 마지막 범주와 일치하도록 변경됩니다. 이전에 범주가 정의되지 않은 경우, 축의 최소값도 categories 에 있는 첫 번째 범주와 일치하도록 변경됩니다.

범주는 유효한 QString 이어야 하며 중복될 수 없습니다. 중복된 범주는 추가되지 않습니다.

void append(string category)

축에 category 를 추가합니다. 축의 최대값은 마지막 category 값에 맞춰 변경됩니다. 이전에 범주가 정의되지 않은 경우, 축의 최소값도 category 값에 맞춰 변경됩니다.

범주는 유효한 QString 이어야 하며, 중복될 수 없습니다. 중복된 범주는 추가되지 않습니다.

string at(int index)

index 에 있는 카테고리를 반환합니다.

void clear()

모든 범주를 제거합니다. 축 범위의 최대값과 최소값을 QString::null로 설정합니다.

void insert(int index, string category)

index 에 있는 축에 category 를 삽입합니다. category 는 유효한 QString 이어야 하며, 중복될 수 없습니다. category 가 다른 범주 앞에 추가되거나 뒤에 추가되면, 축의 최소값과 최대값이 그에 따라 업데이트됩니다.

void remove(int index)

index 에 있는 범주를 축에서 제거합니다. 현재 축의 최대값 또는 최소값을 설정하고 있는 범주를 제거하면 축의 범위에 영향을 미칩니다.

void remove(string category)

축에서 ‘ category ’을 제거합니다. 현재 축의 최대값 또는 최소값을 설정하고 있는 범주를 제거하면 축 범위에 영향을 미칩니다.

void replace(string oldCategory, string newCategory)

oldCategory 을 newCategory 으로 대체합니다. 축에 oldCategory 이 존재하지 않으면 아무런 작업도 수행되지 않습니다. newCategory 은 유효한 QString 이어야 하며, 중복될 수 없습니다. 최소 또는 최대 범주가 대체되면 축의 최소 및 최대 값이 그에 따라 업데이트됩니다.

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