QCategoryAxis Class The QCategoryAxis class places named ranges on the axis. More...  
 Header:
 #include <QCategoryAxis> 


 Instantiated By:
 CategoryAxis



 Inherits:
 QValueAxis



 List of all members, including inherited members  Public Types  
 enum 

AxisLabelsPosition { AxisLabelsPositionCenter, AxisLabelsPositionOnValue }
  Properties  
categoriesLabels : const QStringList 
count : const int 
labelsPosition : AxisLabelsPosition 
startValue : qreal   5 properties inherited from QValueAxis
 27 properties inherited from QAbstractAxis
 1 property inherited from QObject
  Public Functions  
 

QCategoryAxis(QObject *parent = Q_NULLPTR)
 
 

~QCategoryAxis()
 
 void 

append(const QString &categoryLabel, qreal categoryEndValue)
 
 QStringList 

categoriesLabels()
 
 int 

count() const
 
 qreal 

endValue(const QString &categoryLabel) const
 
 QCategoryAxis8b7c:f320:99b9:690f:4595:cd17:293a:c069xisLabelsPosition 

labelsPosition() const
 
 void 

remove(const QString &categoryLabel)
 
 void 

replaceLabel(const QString &oldLabel, const QString &newLabel)
 
 void 

setLabelsPosition(QCategoryAxis8b7c:f320:99b9:690f:4595:cd17:293a:c069xisLabelsPosition position)
 
 void 

setStartValue(qreal min)
 
 qreal 

startValue(const QString &categoryLabel = QString()) const
  Reimplemented Public Functions  
 virtual AxisType 

type() const
   12 public functions inherited from QValueAxis
 58 public functions inherited from QAbstractAxis
 32 public functions inherited from QObject
  Signals  
 void 

categoriesChanged()
 
 void 

labelsPositionChanged(QCategoryAxis8b7c:f320:99b9:690f:4595:cd17:293a:c069xisLabelsPosition position)
   6 signals inherited from QValueAxis
 25 signals inherited from QAbstractAxis
 2 signals inherited from QObject
  Additional Inherited Members  1 public slot inherited from QValueAxis
 1 public slot inherited from QObject
 11 static public members inherited from QObject
 9 protected functions inherited from QObject
  Detailed Description The QCategoryAxis class places named ranges on the axis. This class can be used to explain the underlying data by adding labeled categories. Unlike QBarCategoryAxis, QCategoryAxis allows the widths of the category ranges to be specified freely. Example code on how to use QCategoryAxis: 
QChartView *chartView = new QChartView;
QLineSeries *series = new QLineSeries;
// ...
chartView->chart()->addSeries(series);

QCategoryAxis *axisY = new QCategoryAxis;
axisY->setMin(0);
axisY->setMax(52);
axisY->setStartValue(15);
axisY->append("First", 20);
axisY->append("Second", 37);
axisY->append("Third", 52);
chartView->chart()->setAxisY(axisY, series); Member Type Documentation 
enum QCategoryAxis8b7c:f320:99b9:690f:4595:cd17:293a:c069xisLabelsPosition
 This enum describes the position of the category labels. 

Constant
Value
Description
 
QCategoryAxis8b7c:f320:99b9:690f:4595:cd17:293a:c069xisLabelsPositionCenter
0x0
Labels are centered to category.
 
QCategoryAxis8b7c:f320:99b9:690f:4595:cd17:293a:c069xisLabelsPositionOnValue
0x1
Labels are positioned to the high end limit of the category.
   Property Documentation 
categoriesLabels : const QStringList
 This property holds the category labels as a string list. Access functions:  
 QStringList 

categoriesLabels()
  
count : const int
 This property holds the number of categories. Access functions:  
 int 

count() const
  
labelsPosition : AxisLabelsPosition
 This property holds the position of the category labels. The labels in the beginning and in the end of the axes may overlap other axes' labels when positioned on value. Access functions:  
 QCategoryAxis8b7c:f320:99b9:690f:4595:cd17:293a:c069xisLabelsPosition 

labelsPosition() const
 
 void 

setLabelsPosition(QCategoryAxis8b7c:f320:99b9:690f:4595:cd17:293a:c069xisLabelsPosition position)
  Notifier signal:  
 void 

labelsPositionChanged(QCategoryAxis8b7c:f320:99b9:690f:4595:cd17:293a:c069xisLabelsPosition position)
  
startValue : qreal
 This property holds the low end of the first category on the axis. Access functions:  
 qreal 

startValue(const QString &categoryLabel = QString()) const
 
 void 

setStartValue(qreal min)
   Member Function Documentation 
QCategoryAxis8b7c:f320:99b9:690f:4595:cd17:293a:c069QCategoryAxis(QObject *parent = Q_NULLPTR) Constructs an axis object that is a child of parent. 
QCategoryAxis8b7c:f320:99b9:690f:4595:cd17:293a:c069~QCategoryAxis() Destroys the object. 
void QCategoryAxis8b7c:f320:99b9:690f:4595:cd17:293a:c069ppend(const QString &categoryLabel, qreal categoryEndValue) Appends a new category to the axis with the label categoryLabel. A category label has to be unique. categoryEndValue specifies the high end limit of the category. It has to be greater than the high end limit of the previous category. Otherwise the method returns without adding a new category. 
[signal] void QCategoryAxis8b7c:f320:99b9:690f:4595:cd17:293a:c069tegoriesChanged() This signal is emitted when the categories of the axis change. 
QStringList QCategoryAxis8b7c:f320:99b9:690f:4595:cd17:293a:c069tegoriesLabels() Returns the list of the categories' labels. Note: Getter function for property categoriesLabels.  
int QCategoryAxis8b7c:f320:99b9:690f:4595:cd17:293a:c069ount() const Returns the number of categories. Note: Getter function for property count.  
qreal QCategoryAxis8b7c:f320:99b9:690f:4595:cd17:293a:c069ndValue(const QString &categoryLabel) const Returns the high end limit of the category specified by categoryLabel. 
void QCategoryAxis8b7c:f320:99b9:690f:4595:cd17:293a:c069remove(const QString &categoryLabel) Removes a category specified by the label categoryLabel from the axis. 
void QCategoryAxis8b7c:f320:99b9:690f:4595:cd17:293a:c069replaceLabel(const QString &oldLabel, const QString &newLabel) Replaces an existing category label specified by oldLabel with newLabel. If the old label does not exist, the method returns without making any changes. 
void QCategoryAxis8b7c:f320:99b9:690f:4595:cd17:293a:c069setStartValue(qreal min) Sets min to be the low end limit of the first category on the axis. If categories have already been added to the axis, the passed value must be less than the high end value of the already defined first category range. Otherwise nothing is done. Note: Setter function for property startValue. 
See also startValue(). 
qreal QCategoryAxis8b7c:f320:99b9:690f:4595:cd17:293a:c069startValue(const QString &categoryLabel = QString()) const Returns the low end limit of the category specified by categoryLabel. Note: Getter function for property startValue. 
See also setStartValue(). 
[virtual] AxisType QCategoryAxis8b7c:f320:99b9:690f:4595:cd17:293a:c069type() const Reimplemented from QAbstractAxis8b7c:f320:99b9:690f:4595:cd17:293a:c069type(). Returns the type of the axis.

    
{'path': 'public/docs/qt~5.9/qcategoryaxis.html', 'source': 'DevDocs.IO'}