Sophie

Sophie

distrib > Mageia > 6 > x86_64 > media > core-updates > by-pkgid > 19952c5e751bf7e3108c3c59625b0f35 > files > 124

qtcharts5-doc-5.9.4-1.mga6.noarch.rpm

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qcategoryaxis.cpp -->
  <title>QCategoryAxis Class | Qt Charts 5.9</title>
  <link rel="stylesheet" type="text/css" href="style/offline-simple.css" />
  <script type="text/javascript">
    document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css");
    // loading style sheet breaks anchors that were jumped to before
    // so force jumping to anchor again
    setTimeout(function() {
        var anchor = location.hash;
        // need to jump to different anchor first (e.g. none)
        location.hash = "#";
        setTimeout(function() {
            location.hash = anchor;
        }, 0);
    }, 0);
  </script>
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="main">
    <div class="main-rounded">
      <div class="navigationbar">
        <table><tr>
<td >Qt 5.9</td><td ><a href="qtcharts-index.html">Qt Charts</a></td><td ><a href="qt-charts-module.html">C++ Classes</a></td><td >QCategoryAxis</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right">Qt 5.9.4 Reference Documentation</td>
        </tr></table>
      </div>
    </div>
<div class="content">
<div class="line">
<div class="content mainContent">
<div class="sidebar">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#public-types">Public Types</a></li>
<li class="level1"><a href="#properties">Properties</a></li>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#reimplemented-public-functions">Reimplemented Public Functions</a></li>
<li class="level1"><a href="#signals">Signals</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">QCategoryAxis Class</h1>
<!-- $$$QCategoryAxis-brief -->
<p>The <a href="qcategoryaxis.html">QCategoryAxis</a> class places named ranges on the axis. <a href="#details">More...</a></p>
<!-- @@@QCategoryAxis -->
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign">   <span class="preprocessor">#include &lt;QCategoryAxis&gt;</span>
</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Instantiated By:</td><td class="memItemRight bottomAlign"> <a href="qml-qtcharts-categoryaxis.html">CategoryAxis</a></td></tr><tr><td class="memItemLeft rightAlign topAlign"> Inherits:</td><td class="memItemRight bottomAlign"> <a href="qvalueaxis.html">QValueAxis</a></td></tr></table></div><ul>
<li><a href="qcategoryaxis-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="public-types"></a>
<h2 id="public-types">Public Types</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qcategoryaxis.html#AxisLabelsPosition-enum">AxisLabelsPosition</a></b> { AxisLabelsPositionCenter, AxisLabelsPositionOnValue }</td></tr>
</table></div>
<a name="properties"></a>
<h2 id="properties">Properties</h2>
<ul>
<li class="fn"><b><a href="qcategoryaxis.html#categoriesLabels-prop">categoriesLabels</a></b> : const QStringList</li>
<li class="fn"><b><a href="qcategoryaxis.html#count-prop">count</a></b> : const int</li>
<li class="fn"><b><a href="qcategoryaxis.html#labelsPosition-prop">labelsPosition</a></b> : AxisLabelsPosition</li>
<li class="fn"><b><a href="qcategoryaxis.html#startValue-prop">startValue</a></b> : qreal</li>
</ul>
<ul>
<li class="fn">5 properties inherited from <a href="qvalueaxis.html#properties">QValueAxis</a></li>
<li class="fn">27 properties inherited from <a href="qabstractaxis.html#properties">QAbstractAxis</a></li>
</ul>
<a name="public-functions"></a>
<h2 id="public-functions">Public Functions</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qcategoryaxis.html#QCategoryAxis">QCategoryAxis</a></b>(QObject *<i>parent</i> = Q_NULLPTR)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qcategoryaxis.html#dtor.QCategoryAxis">~QCategoryAxis</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcategoryaxis.html#append">append</a></b>(const QString &amp;<i>categoryLabel</i>, qreal <i>categoryEndValue</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QStringList </td><td class="memItemRight bottomAlign"><b><a href="qcategoryaxis.html#categoriesLabels">categoriesLabels</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qcategoryaxis.html#count">count</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qcategoryaxis.html#endValue">endValue</a></b>(const QString &amp;<i>categoryLabel</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QCategoryAxis::AxisLabelsPosition </td><td class="memItemRight bottomAlign"><b><a href="qcategoryaxis.html#labelsPosition-prop">labelsPosition</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcategoryaxis.html#remove">remove</a></b>(const QString &amp;<i>categoryLabel</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcategoryaxis.html#replaceLabel">replaceLabel</a></b>(const QString &amp;<i>oldLabel</i>, const QString &amp;<i>newLabel</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcategoryaxis.html#labelsPosition-prop">setLabelsPosition</a></b>(QCategoryAxis::AxisLabelsPosition <i>position</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcategoryaxis.html#setStartValue">setStartValue</a></b>(qreal <i>min</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qcategoryaxis.html#startValue">startValue</a></b>(const QString &amp;<i>categoryLabel</i> = QString()) const</td></tr>
</table></div>
<a name="reimplemented-public-functions"></a>
<h2 id="reimplemented-public-functions">Reimplemented Public Functions</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> virtual AxisType </td><td class="memItemRight bottomAlign"><b><a href="qcategoryaxis.html#type">type</a></b>() const</td></tr>
</table></div>
<ul>
<li class="fn">12 public functions inherited from <a href="qvalueaxis.html#public-functions">QValueAxis</a></li>
<li class="fn">58 public functions inherited from <a href="qabstractaxis.html#public-functions">QAbstractAxis</a></li>
</ul>
<a name="signals"></a>
<h2 id="signals">Signals</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcategoryaxis.html#categoriesChanged">categoriesChanged</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcategoryaxis.html#labelsPosition-prop">labelsPositionChanged</a></b>(QCategoryAxis::AxisLabelsPosition <i>position</i>)</td></tr>
</table></div>
<ul>
<li class="fn">6 signals inherited from <a href="qvalueaxis.html#signals">QValueAxis</a></li>
<li class="fn">25 signals inherited from <a href="qabstractaxis.html#signals">QAbstractAxis</a></li>
</ul>
<h3>Additional Inherited Members</h3>
<ul>
<li class="fn">1 public slot inherited from <a href="qvalueaxis.html#public-slots">QValueAxis</a></li>
</ul>
<a name="details"></a>
<!-- $$$QCategoryAxis-description -->
<div class="descr">
<h2 id="details">Detailed Description</h2>
<p>The <a href="qcategoryaxis.html">QCategoryAxis</a> class places named ranges on the axis.</p>
<p>This class can be used to explain the underlying data by adding labeled categories. Unlike <a href="qbarcategoryaxis.html">QBarCategoryAxis</a>, <a href="qcategoryaxis.html">QCategoryAxis</a> allows the widths of the category ranges to be specified freely.</p>
<p>Example code on how to use <a href="qcategoryaxis.html">QCategoryAxis</a>:</p>
<p class="centerAlign"><img src="images/api_category_axis.png" alt="" /></p><pre class="cpp">

  <span class="type"><a href="qchartview.html">QChartView</a></span> <span class="operator">*</span>chartView <span class="operator">=</span> <span class="keyword">new</span> <span class="type"><a href="qchartview.html">QChartView</a></span>;
  <span class="type"><a href="qlineseries.html">QLineSeries</a></span> <span class="operator">*</span>series <span class="operator">=</span> <span class="keyword">new</span> <span class="type"><a href="qlineseries.html">QLineSeries</a></span>;
  <span class="comment">// ...</span>
  chartView<span class="operator">-</span><span class="operator">&gt;</span>chart()<span class="operator">-</span><span class="operator">&gt;</span>addSeries(series);

  <span class="type"><a href="qcategoryaxis.html#QCategoryAxis">QCategoryAxis</a></span> <span class="operator">*</span>axisY <span class="operator">=</span> <span class="keyword">new</span> <span class="type"><a href="qcategoryaxis.html#QCategoryAxis">QCategoryAxis</a></span>;
  axisY<span class="operator">-</span><span class="operator">&gt;</span>setMin(<span class="number">0</span>);
  axisY<span class="operator">-</span><span class="operator">&gt;</span>setMax(<span class="number">52</span>);
  axisY<span class="operator">-</span><span class="operator">&gt;</span>setStartValue(<span class="number">15</span>);
  axisY<span class="operator">-</span><span class="operator">&gt;</span>append(<span class="string">&quot;First&quot;</span><span class="operator">,</span> <span class="number">20</span>);
  axisY<span class="operator">-</span><span class="operator">&gt;</span>append(<span class="string">&quot;Second&quot;</span><span class="operator">,</span> <span class="number">37</span>);
  axisY<span class="operator">-</span><span class="operator">&gt;</span>append(<span class="string">&quot;Third&quot;</span><span class="operator">,</span> <span class="number">52</span>);
  chartView<span class="operator">-</span><span class="operator">&gt;</span>chart()<span class="operator">-</span><span class="operator">&gt;</span>setAxisY(axisY<span class="operator">,</span> series);

</pre>
</div>
<!-- @@@QCategoryAxis -->
<div class="types">
<h2>Member Type Documentation</h2>
<!-- $$$AxisLabelsPosition$$$AxisLabelsPositionCenter$$$AxisLabelsPositionOnValue -->
<h3 class="fn" id="AxisLabelsPosition-enum"><a name="AxisLabelsPosition-enum"></a>enum QCategoryAxis::<span class="name">AxisLabelsPosition</span></h3>
<p>This enum describes the position of the category labels.</p>
<div class="table"><table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><code>QCategoryAxis::AxisLabelsPositionCenter</code></td><td class="topAlign tblval"><code>0x0</code></td><td class="topAlign">Labels are centered to category.</td></tr>
<tr><td class="topAlign"><code>QCategoryAxis::AxisLabelsPositionOnValue</code></td><td class="topAlign tblval"><code>0x1</code></td><td class="topAlign">Labels are positioned to the high end limit of the category.</td></tr>
</table></div>
<!-- @@@AxisLabelsPosition -->
</div>
<div class="prop">
<h2>Property Documentation</h2>
<!-- $$$categoriesLabels-prop$$$categoriesLabels -->
<h3 class="fn" id="categoriesLabels-prop"><a name="categoriesLabels-prop"></a><span class="name">categoriesLabels</span> : const <span class="type">QStringList</span></h3>
<p>This property holds the category labels as a string list.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> QStringList </td><td class="memItemRight bottomAlign"><span class="name"><b><a href="qcategoryaxis.html#categoriesLabels">categoriesLabels</a></b></span>()</td></tr>
</table></div>
<!-- @@@categoriesLabels -->
<!-- $$$count-prop$$$count -->
<h3 class="fn" id="count-prop"><a name="count-prop"></a><span class="name">count</span> : const <span class="type">int</span></h3>
<p>This property holds the number of categories.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> int </td><td class="memItemRight bottomAlign"><span class="name"><b><a href="qcategoryaxis.html#count">count</a></b></span>() const</td></tr>
</table></div>
<!-- @@@count -->
<!-- $$$labelsPosition-prop$$$labelsPosition$$$setLabelsPositionQCategoryAxis::AxisLabelsPosition$$$labelsPositionChangedQCategoryAxis::AxisLabelsPosition -->
<h3 class="fn" id="labelsPosition-prop"><a name="labelsPosition-prop"></a><span class="name">labelsPosition</span> : <span class="type"><a href="qcategoryaxis.html#AxisLabelsPosition-enum">AxisLabelsPosition</a></span></h3>
<p>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.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> QCategoryAxis::AxisLabelsPosition </td><td class="memItemRight bottomAlign"><span class="name"><b>labelsPosition</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setLabelsPosition</b></span>(QCategoryAxis::AxisLabelsPosition <i>position</i>)</td></tr>
</table></div>
<p><b>Notifier signal:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>labelsPositionChanged</b></span>(QCategoryAxis::AxisLabelsPosition <i>position</i>)</td></tr>
</table></div>
<!-- @@@labelsPosition -->
<!-- $$$startValue-prop$$$startValueconstQString&$$$setStartValueqreal -->
<h3 class="fn" id="startValue-prop"><a name="startValue-prop"></a><span class="name">startValue</span> : <span class="type">qreal</span></h3>
<p>This property holds the low end of the first category on the axis.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> qreal </td><td class="memItemRight bottomAlign"><span class="name"><b><a href="qcategoryaxis.html#startValue">startValue</a></b></span>(const QString &amp;<i>categoryLabel</i> = QString()) const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b><a href="qcategoryaxis.html#setStartValue">setStartValue</a></b></span>(qreal <i>min</i>)</td></tr>
</table></div>
<!-- @@@startValue -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QCategoryAxis[overload1]$$$QCategoryAxisQObject* -->
<h3 class="fn" id="QCategoryAxis"><a name="QCategoryAxis"></a>QCategoryAxis::<span class="name">QCategoryAxis</span>(<span class="type">QObject</span> *<i>parent</i> = Q_NULLPTR)</h3>
<p>Constructs an axis object that is a child of <i>parent</i>.</p>
<!-- @@@QCategoryAxis -->
<!-- $$$~QCategoryAxis[overload1]$$$~QCategoryAxis -->
<h3 class="fn" id="dtor.QCategoryAxis"><a name="dtor.QCategoryAxis"></a>QCategoryAxis::<span class="name">~QCategoryAxis</span>()</h3>
<p>Destroys the object.</p>
<!-- @@@~QCategoryAxis -->
<!-- $$$append[overload1]$$$appendconstQString&qreal -->
<h3 class="fn" id="append"><a name="append"></a><span class="type">void</span> QCategoryAxis::<span class="name">append</span>(const <span class="type">QString</span> &amp;<i>categoryLabel</i>, <span class="type">qreal</span> <i>categoryEndValue</i>)</h3>
<p>Appends a new category to the axis with the label <i>categoryLabel</i>. A category label has to be unique. <i>categoryEndValue</i> 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.</p>
<!-- @@@append -->
<!-- $$$categoriesChanged[overload1]$$$categoriesChanged -->
<h3 class="fn" id="categoriesChanged"><a name="categoriesChanged"></a><code>[signal] </code><span class="type">void</span> QCategoryAxis::<span class="name">categoriesChanged</span>()</h3>
<p>This signal is emitted when the categories of the axis change.</p>
<!-- @@@categoriesChanged -->
<!-- $$$categoriesLabels -->
<h3 class="fn" id="categoriesLabels"><a name="categoriesLabels"></a><span class="type">QStringList</span> QCategoryAxis::<span class="name">categoriesLabels</span>()</h3>
<p>Returns the list of the categories' labels.</p>
<p><b>Note:</b> Getter function for property <a href="qcategoryaxis.html#categoriesLabels-prop">categoriesLabels</a>. </p><!-- @@@categoriesLabels -->
<!-- $$$count -->
<h3 class="fn" id="count"><a name="count"></a><span class="type">int</span> QCategoryAxis::<span class="name">count</span>() const</h3>
<p>Returns the number of categories.</p>
<p><b>Note:</b> Getter function for property <a href="qcategoryaxis.html#count-prop">count</a>. </p><!-- @@@count -->
<!-- $$$endValue[overload1]$$$endValueconstQString& -->
<h3 class="fn" id="endValue"><a name="endValue"></a><span class="type">qreal</span> QCategoryAxis::<span class="name">endValue</span>(const <span class="type">QString</span> &amp;<i>categoryLabel</i>) const</h3>
<p>Returns the high end limit of the category specified by <i>categoryLabel</i>.</p>
<!-- @@@endValue -->
<!-- $$$remove[overload1]$$$removeconstQString& -->
<h3 class="fn" id="remove"><a name="remove"></a><span class="type">void</span> QCategoryAxis::<span class="name">remove</span>(const <span class="type">QString</span> &amp;<i>categoryLabel</i>)</h3>
<p>Removes a category specified by the label <i>categoryLabel</i> from the axis.</p>
<!-- @@@remove -->
<!-- $$$replaceLabel[overload1]$$$replaceLabelconstQString&constQString& -->
<h3 class="fn" id="replaceLabel"><a name="replaceLabel"></a><span class="type">void</span> QCategoryAxis::<span class="name">replaceLabel</span>(const <span class="type">QString</span> &amp;<i>oldLabel</i>, const <span class="type">QString</span> &amp;<i>newLabel</i>)</h3>
<p>Replaces an existing category label specified by <i>oldLabel</i> with <i>newLabel</i>. If the old label does not exist, the method returns without making any changes.</p>
<!-- @@@replaceLabel -->
<!-- $$$setStartValue -->
<h3 class="fn" id="setStartValue"><a name="setStartValue"></a><span class="type">void</span> QCategoryAxis::<span class="name">setStartValue</span>(<span class="type">qreal</span> <i>min</i>)</h3>
<p>Sets <i>min</i> 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.</p>
<p><b>Note:</b> Setter function for property <a href="qcategoryaxis.html#startValue-prop">startValue</a>. </p><p><b>See also </b><a href="qcategoryaxis.html#startValue">startValue</a>().</p>
<!-- @@@setStartValue -->
<!-- $$$startValue -->
<h3 class="fn" id="startValue"><a name="startValue"></a><span class="type">qreal</span> QCategoryAxis::<span class="name">startValue</span>(const <span class="type">QString</span> &amp;<i>categoryLabel</i> = QString()) const</h3>
<p>Returns the low end limit of the category specified by <i>categoryLabel</i>.</p>
<p><b>Note:</b> Getter function for property <a href="qcategoryaxis.html#startValue-prop">startValue</a>. </p><p><b>See also </b><a href="qcategoryaxis.html#setStartValue">setStartValue</a>().</p>
<!-- @@@startValue -->
<!-- $$$type[overload1]$$$type -->
<h3 class="fn" id="type"><a name="type"></a><code>[virtual] </code><span class="type"><a href="qabstractaxis.html#AxisType-enum">AxisType</a></span> QCategoryAxis::<span class="name">type</span>() const</h3>
<p>Reimplemented from <a href="qabstractaxis.html#type">QAbstractAxis::type</a>().</p>
<p>Returns the type of the axis.</p>
<!-- @@@type -->
</div>
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2017 The Qt Company Ltd.
   Documentation contributions included herein are the copyrights of
   their respective owners.<br>    The documentation provided herein is licensed under the terms of the    <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation    License version 1.3</a> as published by the Free Software Foundation.<br>    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. </p>
</div>
</body>
</html>