- Qt 6.8
- Qt Graphs
- QML Types
- QtGraphs
- BarCategoryAxis
- Qt Graphs | Commercial or GPLv3

# BarCategoryAxis QML Type

Adds categories to a graph's axes. More...

Import Statement: | import QtGraphs
Instantiates: | QBarCategoryAxis
Inherits: | AbstractAxis

- List of all members, including inherited members
- BarCategoryAxis is part of Qt Graphs QML Types for 2D.

## Properties

- categories : list
- count : int
- max : string
- min : string

## Signals

- categoryRangeChanged(string min, string max)

## Methods

- void clear()

## Detailed Description

The BarCategoryAxis type can be set up to show an axis line with tick marks, grid lines, and shades. Categories are drawn between the ticks.

The following QML snippet illustrates how to use BarCategoryAxis:

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

## Property Documentation

categories : list

The categories of an axis.

count : int `[read-only]`

The number of categories of an axis.

max : string

The maximum value on the axis.

min : string

The minimum value on the axis.

## Signal Documentation

categoryRangeChanged(string min, string max)

This signal is emitted when min or max value of the axis changes.

The corresponding signal handler is `onCategoryRangeChanged`.

Note: The corresponding handler is `onCategoryRangeChanged`.

## Method Documentation

void clear()

Removes all categories. Sets the maximum and minimum values of the axis range to QString::null.