本页内容

LogValueAxis QML Type

为图表的坐标轴添加对数刻度。更多...

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

AbstractAxis

Status: Deprecated

此类型已弃用。我们强烈建议不要在新代码中使用它。

属性

信号

详细说明

对数刻度是一种基于数量级的非线性刻度,因此坐标轴上的每个刻度值都是前一个刻度值乘以某个系数的结果。

注意:如果将 LogValueAxis 类型附加到一个系列上,而该系列在关联维度上包含一个或多个负值或零值的点,则该系列将完全不会被绘制出来。在使用 XYModelMappers 时,这一点尤为重要,因为模型中的空单元格通常包含零值。

属性文档

base : real

对数的底数。

该值必须大于0,且不能等于1。

labelFormat : string

坐标轴的标签格式。

该格式字符串支持标准 C++ 库中printf() 提供的以下转换指定符、长度修饰符和标志:d、i、o、x、X、f、F、e、E、g、G、c。

如果ChartView.localizeNumbers 的值为true ,则支持的指定符仅限于:d、e、E、f、g、G和i。此外,仅支持精度修饰符。其余格式来自应用程序的默认QLocale 。

另请参阅 QString::asprintf()。

max : real

轴上的最大值。

设置此属性时,系统会根据需要调整最小值,以确保范围保持有效。该值必须大于 0。

min : real

轴上的最小值。

设置此属性时,系统会根据需要调整最大值,以确保范围保持有效。该值必须大于 0。

minorTickCount : int

坐标轴上的小刻度数量。这表示图表中主刻度之间绘制多少条网格线。小刻度不显示标签。默认值为 0。将该值设置为 -1,主刻度之间的网格线数量将自动计算。

tickCount : int [read-only]

轴上的刻度线数量。这表示图表上绘制的网格线数量。该值为只读。

信号文档

minorTickCountChanged(int minorTickCount)

当轴上的小刻度数量(由minorTickCount 指定)发生变化时,会发出此信号。

注意: 相应的处理程序 为onMinorTickCountChanged 。

tickCountChanged(int tickCount)

当由tickCount 指定的坐标轴刻度数发生变化时,会触发此信号。

注意: 相应的处理程序 为onTickCountChanged 。

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