ValueAxis QML Type

Adds values to a chart's axes. 更多...

导入语句: import QtCharts 2.2
实例化: QValueAxis
继承:

AbstractAxis

特性

信号

方法

详细描述

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

以下范例代码阐明如何使用 ValueAxis 类型:

ChartView {
    ValueAxis {
        id: xAxis
        min: 0
        max: 10
    }
// Add a few series...
}
					

特性文档编制

labelFormat : real

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

ChartView.localizeNumbers is true ,支持的说明符限于:d、e、E、f、g、G 和 i。另外,仅支持精度修饰符。其余格式来自默认 QLocale 对于应用程序。

另请参阅 QString::asprintf() .


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.


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.


minorTickCount : int

The number of minor tick marks on the axis. This indicates how many grid lines are drawn between major ticks on the chart. Labels are not drawn for minor ticks. The default value is 0.


tickCount : int

The number of tick marks on the axis. This indicates how many grid lines are drawn on the chart. The default value is 5, and the number cannot be less than 2.


信号文档编制

rangeChanged ( string min , string max )

此信号被发射当 min or max value of the axis changes.

The corresponding signal handler is onRangeChanged .


方法文档编制

applyNiceNumbers ()

修改轴的当前范围和刻度标记数,以使看起来 nice . The algorithm considers numbers that can be expressed as a form of 1*10^n, 2* 10^n, or 5*10^n to be nice numbers. These numbers are used for setting spacing for the tick marks.