- Qt 6.12
- Qt Graphs
- QML Types
- QtGraphs
- LogValueAxis
- Qt Graphs | Commercial or GPLv3

# LogValueAxis QML Type

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

Import Statement: | `import QtGraphs`
Since: | Qt 6.12
In C++: | QLogValueAxis
Inherits: | AbstractAxis

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

## Properties

- base : real
- labelFormat : string
- labelPostFormat : string `(since 6.12)`
- labelPrecision : int
- max : real
- min : real
- pan : real
- subTickCount : int
- tickCount : int
- visualMax : real
- visualMin : real
- zoom : real

## Signals

- labelFormatChanged(string format)
- labelPostFormatChanged(string format) `(since 6.12)`
- labelPrecisionChanged(int precision)
- maxChanged(real max)
- minChanged(real min)
- rangeChanged(real min, real max)
- subTickCountChanged(int subTickCount)
- tickCountChanged(int tickCount)

## Detailed Description

The LogValueAxis type can be set up to show an axis line with tick marks, grid lines, and shades. The values on the axis are drawn at the positions of tick marks.

The following example code illustrates how to use the LogValueAxis type:

     GraphsView {
         axisX: LogValueAxis {
             min: 1
             max: 10
         }
         axisY: LogValueAxis {
             min 0.1
             max: 100
         }
         LineSeries {
             // Add a few XYPoint data...
         }
     }

## Property Documentation

### base : real

This base of the logarithm.

The value has to be greater than 0 and cannot equal 1. The default value is 10.0

### labelFormat : string

The format string supports the following conversion specifiers, length modifiers, and flags provided by `printf()` in the standard C++ library: d, i, o, x, X, f, F, e, E, g, G, c. Then the formatted string goes through LogValueAxis::labelPostFormat.

The default value is empty, in which case 'f' format is used.

     LogValueAxis {
         titleText: "Temperature °C"
         labelFormat: "%.2f"
         labelPostFormat: "%1 °C"
         // Results in "2.50 °C"
     }

See also QString::asprintf().

### labelPostFormat : string `[since 6.12]`

The label first goes through LogValueAxis::labelFormat to format the value, then goes through this.

The default value is "%1".

     LogValueAxis {
         titleText: "Temperature °C"
         labelFormat: "%.2f"
         labelPostFormat: "%1 °C"
         // Results in "2.50 °C"
     }

This property was introduced in Qt 6.12.

See also QString::arg().

### labelPrecision : int

The maximum number of significant digits used for showing the labels. The default value is 6. Any negative precision is ignored in favor of the default, 6.

### max : real

The maximum value on the axis.

When setting this property, the minimum value is adjusted if necessary, to ensure that the range remains valid. The default value is 10.0

### min : real

The minimum value on the axis.

When setting this property, the maximum value is adjusted if necessary, to ensure that the range remains valid. The default value is 0.0

### pan : real

The pan value of the axis.

The pan value moves the center of the axis without affecting intervals of grid and labels. The default value is 0.

### subTickCount : int

The number of subticks on the axis. This indicates how many subticks are drawn between major lines on the graph. Labels are not drawn for subticks. Set the value to -1 and the number of subticks will be set equal to the closest integer value of the logarithm base. The default value is -1.

### tickCount : int `[read-only]`

This property holds the number of tick marks on the axis. This value is read-only.

### visualMax : real `[read-only]`

The visual maximum value of the axis.

This property holds a a visual maximum axis value when axis has been panned or zoomed. The default value is max

### visualMin : real `[read-only]`

The visual minimum value of the axis.

This property holds a a visual minimum axis value when axis has been panned or zoomed. The default value is min

### zoom : real

The zoom value of the axis.

The zoom value enlarges or shrinks the axis and thus the graph without affecting intervals of grid and labels. The default value is 1.

## Signal Documentation

### labelFormatChanged(string format)

This signal is emitted when the format of axis labels changes to format.

Note: The corresponding handler is `onLabelFormatChanged`.

### `[since 6.12]` labelPostFormatChanged(string format)

This signal is emitted when the post format of axis labels changes to format.

Note: The corresponding handler is `onLabelPostFormatChanged`.

This signal was introduced in Qt 6.12.

### labelPrecisionChanged(int precision)

This signal is emitted when the axis label precision changes to precision.

Note: The corresponding handler is `onLabelPrecisionChanged`.

### maxChanged(real max)

This signal is emitted when the maximum value of the axis changes to max.

Note: The corresponding handler is `onMaxChanged`.

### minChanged(real min)

This signal is emitted when the minimum value of the axis changes to min.

Note: The corresponding handler is `onMinChanged`.

### rangeChanged(real min, real max)

This signal is emitted when the minimum or maximum value of the axis changes to min and max, respectively.

Note: The corresponding handler is `onRangeChanged`.

### subTickCountChanged(int subTickCount)

This signal is emitted when the number of subticks on the axis, specified by subTickCount, changes.

Note: The corresponding handler is `onSubTickCountChanged`.

### tickCountChanged(int tickCount)

This signal is emitted when the tick Count value, changes to tickCount.

Note: The corresponding handler is `onTickCountChanged`.