QBarCategoryAxis 類

The QBarCategoryAxis 類將類彆添加到圖錶軸。 更多...

頭: #include <QBarCategoryAxis>
實例化: BarCategoryAxis
繼承: QAbstractAxis

特性

公共函數

QBarCategoryAxis (QObject * parent = Q_NULLPTR)
~QBarCategoryAxis ()
void append (const QStringList & categories )
void append (const QString & category )
QString at (int index ) const
QStringList categories ()
void clear ()
int count () const
void insert (int index , const QString & category )
QString max () const
QString min () const
void remove (const QString & category )
void replace (const QString & oldCategory , const QString & newCategory )
void setCategories (const QStringList & categories )
void setMax (const QString & max )
void setMin (const QString & min )
void setRange (const QString & minCategory , const QString & maxCategory )

重實現公共函數

virtual AxisType type () const

信號

void categoriesChanged ()
void countChanged ()
void maxChanged (const QString & max )
void minChanged (const QString & min )
void rangeChanged (const QString & min , const QString & max )

額外繼承成員

詳細描述

The QBarCategoryAxis 類將類彆添加到圖錶軸。

QBarCategoryAxis can be set up to show an axis line with tick marks, grid lines, and shades. Categories are drawn between the ticks. It can be used also with a line series, as demonstrated by the 綫和條形圖範例 .

The following code illustrates how to use QBarCategoryAxis :

QChartView *chartView = new QChartView;
QBarSeries *series = new QBarSeries;
// ...
chartView->chart()->addSeries(series);
chartView->chart()->createDefaultAxes();
QBarCategoryAxis *axisX = new QBarCategoryAxis;
QStringList categories;
categories << "Jan" << "Feb" << "Mar" << "Apr" << "May" << "Jun";
axisX->append(categories);
axisX->setRange("Feb", "May");
chartView->chart()->setAxisX(axisX, series);
					

特性文檔編製

categories : QStringList

This property holds the categories of an axis.

訪問函數:

QStringList categories ()
void setCategories (const QStringList & categories )

通知程序信號:

void categoriesChanged ()

count : const int

This property holds the number of categories of an axis.

訪問函數:

int count () const

通知程序信號:

void countChanged ()

max : QString

此特性保持軸的最大值。

訪問函數:

QString max () const
void setMax (const QString & max )

通知程序信號:

void maxChanged (const QString & max )

min : QString

此特性保持軸的最小值。

訪問函數:

QString min () const
void setMin (const QString & min )

通知程序信號:

void minChanged (const QString & min )

成員函數文檔編製

QBarCategoryAxis:: QBarCategoryAxis ( QObject * parent = Q_NULLPTR)

Constructs an axis object that is the child of parent .

QBarCategoryAxis:: ~QBarCategoryAxis ()

Destroys the axis object.

void QBarCategoryAxis:: append (const QStringList & categories )

追加 categories to an axis. The maximum value on the axis will be changed to match the last category in categories . If no categories were previously defined, the minimum value on the axis will also be changed to match the first category in categories .

A category has to be a valid QString and it cannot be duplicated. Duplicated categories will not be appended.

void QBarCategoryAxis:: append (const QString & category )

追加 category to an axis. The maximum value on the axis will be changed to match the last category . If no categories were previously defined, the minimum value on the axis will also be changed to match category .

A category has to be a valid QString and it cannot be duplicated. Duplicated categories will not be appended.

QString QBarCategoryAxis:: at ( int index ) const

Returns the category at index . The index must be valid.

QStringList QBarCategoryAxis:: categories ()

Returns categories.

注意: getter 函數對於特性 categories .

另請參閱 setCategories ().

[signal] void QBarCategoryAxis:: categoriesChanged ()

This signal is emitted when the categories of the axis change.

注意: 通知程序信號對於特性 categories .

void QBarCategoryAxis:: clear ()

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

int QBarCategoryAxis:: count () const

Returns the number of categories.

注意: getter 函數對於特性 count .

[signal] void QBarCategoryAxis:: countChanged ()

This signal is emitted when the number of categories of an axis changes.

注意: 通知程序信號對於特性 count .

void QBarCategoryAxis:: insert ( int index , const QString & category )

插入 category to the axis at index . category has to be a valid QString and it cannot be duplicated. If category is prepended or appended to other categories, the minimum and maximum values on the axis are updated accordingly.

QString QBarCategoryAxis:: max () const

Returns the maximum category.

注意: getter 函數對於特性 max .

另請參閱 setMax ().

[signal] void QBarCategoryAxis:: maxChanged (const QString & max )

此信號被發射當 max value of the axis changes.

注意: 通知程序信號對於特性 max .

QString QBarCategoryAxis:: min () const

Returns the minimum category.

注意: getter 函數對於特性 min .

另請參閱 setMin ().

[signal] void QBarCategoryAxis:: minChanged (const QString & min )

此信號被發射當 min value of the axis changes.

注意: 通知程序信號對於特性 min .

[signal] void QBarCategoryAxis:: rangeChanged (const QString & min , const QString & max )

此信號發射,當 min or max value of the axis changes.

void QBarCategoryAxis:: remove (const QString & category )

移除 category from the axis. Removing a category that currently sets the maximum or minimum value on the axis will affect the axis range.

void QBarCategoryAxis:: replace (const QString & oldCategory , const QString & newCategory )

替換 oldCategory with newCategory 。若 oldCategory does not exist on the axis, nothing is done. newCategory has to be a valid QString and it cannot be duplicated. If the minimum or maximum category is replaced, the minimum and maximum values on the axis are updated accordingly.

void QBarCategoryAxis:: setCategories (const QStringList & categories )

categories and discards the old ones. The axis range is adjusted to match the first and last category in categories .

A category has to be a valid QString and it cannot be duplicated.

注意: setter 函數對於特性 categories .

另請參閱 categories ().

void QBarCategoryAxis:: setMax (const QString & max )

Sets the maximum category to max .

注意: setter 函數對於特性 max .

另請參閱 max ().

void QBarCategoryAxis:: setMin (const QString & min )

Sets the minimum category to min .

注意: setter 函數對於特性 min .

另請參閱 min ().

void QBarCategoryAxis:: setRange (const QString & minCategory , const QString & maxCategory )

Sets the axis range from minCategory to maxCategory .

[虛擬] AxisType QBarCategoryAxis:: type () const

重實現自 QAbstractAxis::type ().

返迴軸的類型。