qbarcategoryaxis.cpp
594 lines
| 15.9 KiB
| text/x-c
|
CppLexer
|
r1613 | /**************************************************************************** | ||
** | ||||
** Copyright (C) 2012 Digia Plc | ||||
** All rights reserved. | ||||
** For any questions to Digia, please use contact form at http://qt.digia.com | ||||
** | ||||
** This file is part of the Qt Commercial Charts Add-on. | ||||
** | ||||
** $QT_BEGIN_LICENSE$ | ||||
** Licensees holding valid Qt Commercial licenses may use this file in | ||||
** accordance with the Qt Commercial License Agreement provided with the | ||||
** Software or, alternatively, in accordance with the terms contained in | ||||
** a written agreement between you and Digia. | ||||
** | ||||
** If you have questions regarding the use of this file, please use | ||||
** contact form at http://qt.digia.com | ||||
** $QT_END_LICENSE$ | ||||
** | ||||
****************************************************************************/ | ||||
|
r1810 | #include "qbarcategoryaxis.h" | ||
#include "qbarcategoryaxis_p.h" | ||||
#include "chartbarcategoryaxisx_p.h" | ||||
#include "chartbarcategoryaxisy_p.h" | ||||
|
r2275 | #include "abstractdomain_p.h" | ||
|
r2273 | #include "qchart.h" | ||
|
r1613 | #include <qmath.h> | ||
QTCOMMERCIALCHART_BEGIN_NAMESPACE | ||||
|
r1624 | /*! | ||
|
r1809 | \class QBarCategoryAxis | ||
\brief The QBarCategoryAxis class is used for manipulating chart's axis. | ||||
|
r1624 | \mainclass | ||
|
r1869 | BarCategoryAxis can be setup to show axis line with tick marks, grid lines and shades. | ||
|
r1650 | Categories are drawn between ticks. Note that you can use this also with lineseries too. | ||
See the \l {Line and BarChart Example} {Line and BarChart Example} to learn how to do that. | ||||
|
r1891 | |||
Example code on how to use QBarCategoryAxis. | ||||
\code | ||||
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); | ||||
|
r2108 | axisX->setRange("Feb", "May"); | ||
chartView->chart()->setAxisX(axisX, series); | ||||
|
r1891 | \endcode | ||
|
r1624 | */ | ||
/*! | ||||
|
r1869 | \qmlclass BarCategoryAxis QBarCategoryAxis | ||
\inherits AbstractAxis | ||||
|
r1624 | \brief The Axis element is used for manipulating chart's axes. | ||
Axis can be setup to show axis line with tick marks, grid lines and shades. | ||||
|
r1650 | Categories are drawn between ticks. Note that you can use this also with lineseries too. | ||
|
r1624 | |||
|
r1869 | To access BarCategoryAxis you can use ChartView API. For example: | ||
|
r1624 | \code | ||
ChartView { | ||||
|
r1869 | BarCategoryAxis { | ||
|
r1639 | id: categoryAxis | ||
categories: ["Jan", "Feb", "Mar", "Apr", "May", "Jun" ] | ||||
} | ||||
// Add a few series... | ||||
|
r1624 | } | ||
\endcode | ||||
*/ | ||||
/*! | ||||
|
r1809 | \property QBarCategoryAxis::categories | ||
|
r1624 | Defines the categories of axis | ||
*/ | ||||
/*! | ||||
|
r1869 | \qmlproperty QStringList BarCategoryAxis::categories | ||
|
r1624 | Defines the categories of axis | ||
*/ | ||||
/*! | ||||
|
r1809 | \property QBarCategoryAxis::min | ||
|
r1624 | Defines the minimum value on the axis. | ||
*/ | ||||
/*! | ||||
|
r2331 | \qmlproperty string BarCategoryAxis::min | ||
|
r1624 | Defines the minimum value on the axis. | ||
*/ | ||||
/*! | ||||
|
r1809 | \property QBarCategoryAxis::max | ||
|
r1624 | Defines the maximum value on the axis. | ||
*/ | ||||
/*! | ||||
|
r2331 | \qmlproperty string BarCategoryAxis::max | ||
|
r1624 | Defines the maximum value on the axis. | ||
*/ | ||||
|
r2249 | /*! | ||
\property QBarCategoryAxis::count | ||||
The count of categories. | ||||
*/ | ||||
/*! | ||||
\qmlproperty int BarCategoryAxis::count | ||||
The count of categories. | ||||
*/ | ||||
|
r1657 | |||
/*! | ||||
|
r1809 | \fn void QBarCategoryAxis::categoriesChanged() | ||
|
r1657 | Axis emits signal when the categories of the axis has changed. | ||
*/ | ||||
|
r2249 | |||
|
r1624 | /*! | ||
|
r1809 | \fn void QBarCategoryAxis::minChanged(const QString &min) | ||
|
r1624 | Axis emits signal when \a min of axis has changed. | ||
*/ | ||||
|
r1654 | /*! | ||
|
r1869 | \qmlsignal BarCategoryAxis::onMinChanged(const QString &min) | ||
|
r1654 | Axis emits signal when \a min of axis has changed. | ||
*/ | ||||
|
r1624 | |||
/*! | ||||
|
r1809 | \fn void QBarCategoryAxis::maxChanged(const QString &max) | ||
|
r1624 | Axis emits signal when \a max of axis has changed. | ||
*/ | ||||
|
r1654 | /*! | ||
|
r1869 | \qmlsignal BarCategoryAxis::onMaxChanged(const QString &max) | ||
|
r1654 | Axis emits signal when \a max of axis has changed. | ||
*/ | ||||
|
r1624 | |||
|
r2249 | /*! | ||
\fn void QBarCategoryAxis::countChanged() | ||||
Axis emits signal when the count of categories has changed. | ||||
*/ | ||||
/*! | ||||
\qmlsignal BarCategoryAxis::onCountChanged() | ||||
Axis emits signal when the count of categories has changed. | ||||
*/ | ||||
|
r1624 | /*! | ||
|
r1809 | \fn void QBarCategoryAxis::rangeChanged(const QString &min, const QString &max) | ||
|
r1624 | Axis emits signal when \a min or \a max of axis has changed. | ||
*/ | ||||
|
r1613 | |||
|
r1636 | /*! | ||
Constructs an axis object which is a child of \a parent. | ||||
*/ | ||||
|
r1808 | QBarCategoryAxis::QBarCategoryAxis(QObject *parent): | ||
|
r2097 | QAbstractAxis(*new QBarCategoryAxisPrivate(this), parent) | ||
|
r1613 | { | ||
} | ||||
|
r1638 | /*! | ||
Destroys the object | ||||
*/ | ||||
|
r1808 | QBarCategoryAxis::~QBarCategoryAxis() | ||
|
r1613 | { | ||
|
r1808 | Q_D(QBarCategoryAxis); | ||
|
r2273 | if (d->m_chart) | ||
d->m_chart->removeAxis(this); | ||||
|
r1613 | } | ||
|
r1638 | /*! | ||
\internal | ||||
*/ | ||||
|
r2097 | QBarCategoryAxis::QBarCategoryAxis(QBarCategoryAxisPrivate &d, QObject *parent) | ||
: QAbstractAxis(d, parent) | ||||
|
r1613 | { | ||
} | ||||
/*! | ||||
|
r2121 | Appends \a categories to axis. A maximum of the axis will be changed to last category in \a categories. | ||
If there were no categories previously defined, minimum of axis will be also changed to first category in \a categories. | ||||
A category has to be valid QStrings and can not be duplicated. Duplicated categories will not be appended. | ||||
|
r1613 | */ | ||
|
r1808 | void QBarCategoryAxis::append(const QStringList &categories) | ||
|
r1613 | { | ||
|
r2097 | if (categories.isEmpty()) | ||
|
r2131 | return; | ||
|
r1640 | |||
|
r1808 | Q_D(QBarCategoryAxis); | ||
|
r2121 | |||
int count = d->m_categories.count(); | ||||
|
r2131 | foreach(QString category, categories) { | ||
if (!d->m_categories.contains(category) && !category.isNull()) { | ||||
|
r2121 | d->m_categories.append(category); | ||
} | ||||
} | ||||
|
r2131 | if (d->m_categories.count() == count) | ||
return; | ||||
|
r2121 | |||
|
r2131 | if (count == 0) | ||
|
r2121 | setRange(d->m_categories.first(), d->m_categories.last()); | ||
|
r2131 | else | ||
|
r2121 | setRange(d->m_minCategory, d->m_categories.last()); | ||
|
r1613 | emit categoriesChanged(); | ||
|
r2249 | emit countChanged(); | ||
|
r1613 | } | ||
/*! | ||||
|
r2121 | Appends \a category to axis. A maximum of the axis will be changed to last \a category. | ||
If there were no categories previously defined, minimum of axis will be also changed to \a category. | ||||
A \a category has to be valid QStrings and can not be duplicated. Duplicated categories will not be appended. | ||||
|
r1613 | */ | ||
|
r1808 | void QBarCategoryAxis::append(const QString &category) | ||
|
r1613 | { | ||
|
r1808 | Q_D(QBarCategoryAxis); | ||
|
r2121 | |||
int count = d->m_categories.count(); | ||||
|
r2131 | if (!d->m_categories.contains(category) && !category.isNull()) | ||
|
r1662 | d->m_categories.append(category); | ||
|
r2121 | |||
|
r2131 | if (d->m_categories.count() == count) | ||
return; | ||||
|
r2121 | |||
|
r2131 | if (count == 0) | ||
|
r2121 | setRange(d->m_categories.last(), d->m_categories.last()); | ||
|
r2131 | else | ||
|
r2121 | setRange(d->m_minCategory, d->m_categories.last()); | ||
|
r1662 | emit categoriesChanged(); | ||
|
r2249 | emit countChanged(); | ||
|
r1613 | } | ||
/*! | ||||
|
r2121 | Removes \a category from axis. Removing category which is currently maximum or minimum | ||
will affect the axis range. | ||||
|
r1613 | */ | ||
|
r1808 | void QBarCategoryAxis::remove(const QString &category) | ||
|
r1613 | { | ||
|
r1808 | Q_D(QBarCategoryAxis); | ||
|
r2121 | |||
|
r1613 | if (d->m_categories.contains(category)) { | ||
d->m_categories.removeAt(d->m_categories.indexOf(category)); | ||||
|
r2131 | if (!d->m_categories.isEmpty()) { | ||
if (d->m_minCategory == category) { | ||||
|
r2121 | setRange(d->m_categories.first(), d->m_maxCategory); | ||
|
r2131 | } else if (d->m_maxCategory == category) { | ||
|
r2121 | setRange(d->m_minCategory, d->m_categories.last()); | ||
} else { | ||||
|
r2400 | d->updateCategoryDomain(); | ||
|
r2121 | } | ||
|
r2131 | } else { | ||
|
r2097 | setRange(QString::null, QString::null); | ||
|
r2131 | } | ||
|
r1613 | emit categoriesChanged(); | ||
|
r2249 | emit countChanged(); | ||
|
r1613 | } | ||
} | ||||
/*! | ||||
|
r2121 | Inserts \a category to axis at \a index. A \a category has to be valid QStrings and can not be duplicated. | ||
If \a category is prepended or appended to categories, minimum and maximum of axis is updated accordingly. | ||||
|
r1613 | */ | ||
|
r1808 | void QBarCategoryAxis::insert(int index, const QString &category) | ||
|
r1613 | { | ||
|
r1808 | Q_D(QBarCategoryAxis); | ||
|
r2121 | |||
int count = d->m_categories.count(); | ||||
|
r2131 | if (!d->m_categories.contains(category) && !category.isNull()) | ||
|
r2097 | d->m_categories.insert(index, category); | ||
|
r2121 | |||
|
r2131 | if (d->m_categories.count() == count) | ||
return; | ||||
|
r2121 | |||
if (count == 0) { | ||||
setRange(d->m_categories.first(), d->m_categories.first()); | ||||
} else if (index == 0) { | ||||
setRange(d->m_categories.first(), d->m_maxCategory); | ||||
|
r2131 | } else if (index == count) { | ||
|
r2121 | setRange(d->m_minCategory, d->m_categories.last()); | ||
|
r2097 | } else { | ||
|
r2400 | d->updateCategoryDomain(); | ||
|
r1613 | } | ||
|
r2121 | |||
|
r1613 | emit categoriesChanged(); | ||
|
r2249 | emit countChanged(); | ||
|
r1613 | } | ||
|
r1774 | /*! | ||
|
r2121 | Replaces \a oldCategory with \a newCategory. If \a oldCategory does not exits on the axis nothing is done. | ||
|
r2249 | A \a newCategory has to be valid QStrings and can not be duplicated. In case of replacing minimum or maximum category, | ||
|
r2121 | minimum and maximum of axis is updated accordingly. | ||
|
r1774 | */ | ||
|
r1808 | void QBarCategoryAxis::replace(const QString &oldCategory, const QString &newCategory) | ||
|
r1774 | { | ||
|
r1808 | Q_D(QBarCategoryAxis); | ||
|
r2121 | |||
|
r1774 | int pos = d->m_categories.indexOf(oldCategory); | ||
|
r2121 | |||
if (pos != -1 && !d->m_categories.contains(newCategory) && !newCategory.isNull()) { | ||||
|
r1774 | d->m_categories.replace(pos, newCategory); | ||
|
r2131 | if (d->m_minCategory == oldCategory) { | ||
|
r2121 | setRange(newCategory, d->m_maxCategory); | ||
|
r2131 | } else if (d->m_maxCategory == oldCategory) { | ||
|
r2121 | setRange(d->m_minCategory, newCategory); | ||
} | ||||
|
r1774 | emit categoriesChanged(); | ||
|
r2249 | emit countChanged(); | ||
|
r1774 | } | ||
} | ||||
|
r1613 | /*! | ||
|
r2121 | Removes all categories. Sets the maximum and minimum of the axis's range to QString::null. | ||
|
r1613 | */ | ||
|
r1808 | void QBarCategoryAxis::clear() | ||
|
r1613 | { | ||
|
r1808 | Q_D(QBarCategoryAxis); | ||
|
r1613 | d->m_categories.clear(); | ||
|
r2131 | setRange(QString::null, QString::null); | ||
|
r1613 | emit categoriesChanged(); | ||
|
r2249 | emit countChanged(); | ||
|
r1613 | } | ||
|
r2121 | /*! | ||
Set \a categories and discards the old ones, range of axis is adjusted to match first and last category in \a categories. | ||||
A category has to be valid QStrings and can not be duplicated. | ||||
*/ | ||||
|
r1808 | void QBarCategoryAxis::setCategories(const QStringList &categories) | ||
|
r1613 | { | ||
|
r1808 | Q_D(QBarCategoryAxis); | ||
|
r2121 | d->m_categories.clear(); | ||
d->m_minCategory = QString::null; | ||||
d->m_maxCategory = QString::null; | ||||
d->m_min = 0; | ||||
d->m_max = 0; | ||||
d->m_count = 0; | ||||
append(categories); | ||||
|
r1613 | } | ||
|
r2121 | /*! | ||
Returns categories | ||||
*/ | ||||
|
r1808 | QStringList QBarCategoryAxis::categories() | ||
|
r1613 | { | ||
|
r1808 | Q_D(QBarCategoryAxis); | ||
|
r1613 | return d->m_categories; | ||
} | ||||
/*! | ||||
Returns number of categories. | ||||
*/ | ||||
|
r1808 | int QBarCategoryAxis::count() const | ||
|
r1613 | { | ||
|
r1808 | Q_D(const QBarCategoryAxis); | ||
|
r1613 | return d->m_categories.count(); | ||
} | ||||
/*! | ||||
Returns category at \a index. Index must be valid. | ||||
*/ | ||||
|
r1808 | QString QBarCategoryAxis::at(int index) const | ||
|
r1613 | { | ||
|
r1808 | Q_D(const QBarCategoryAxis); | ||
|
r1613 | return d->m_categories.at(index); | ||
} | ||||
/*! | ||||
Sets minimum category to \a min. | ||||
*/ | ||||
|
r2104 | void QBarCategoryAxis::setMin(const QString &min) | ||
|
r1613 | { | ||
|
r1808 | Q_D(QBarCategoryAxis); | ||
|
r2273 | d->setRange(min, d->m_maxCategory); | ||
|
r1613 | } | ||
/*! | ||||
Returns minimum category. | ||||
*/ | ||||
|
r1808 | QString QBarCategoryAxis::min() const | ||
|
r1613 | { | ||
|
r1808 | Q_D(const QBarCategoryAxis); | ||
|
r1613 | return d->m_minCategory; | ||
} | ||||
/*! | ||||
Sets maximum category to \a max. | ||||
*/ | ||||
|
r2104 | void QBarCategoryAxis::setMax(const QString &max) | ||
|
r1613 | { | ||
|
r1808 | Q_D(QBarCategoryAxis); | ||
|
r2273 | d->setRange(d->m_minCategory, max); | ||
|
r1613 | } | ||
/*! | ||||
Returns maximum category | ||||
*/ | ||||
|
r1808 | QString QBarCategoryAxis::max() const | ||
|
r1613 | { | ||
|
r1808 | Q_D(const QBarCategoryAxis); | ||
|
r1613 | return d->m_maxCategory; | ||
} | ||||
/*! | ||||
Sets range from \a minCategory to \a maxCategory | ||||
*/ | ||||
|
r2104 | void QBarCategoryAxis::setRange(const QString &minCategory, const QString &maxCategory) | ||
|
r1613 | { | ||
|
r1808 | Q_D(QBarCategoryAxis); | ||
|
r2273 | d->setRange(minCategory,maxCategory); | ||
|
r1613 | } | ||
/*! | ||||
|
r1637 | Returns the type of the axis | ||
|
r1613 | */ | ||
|
r1808 | QAbstractAxis::AxisType QBarCategoryAxis::type() const | ||
|
r1613 | { | ||
|
r1818 | return AxisTypeBarCategory; | ||
|
r1613 | } | ||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | ||||
|
r2104 | QBarCategoryAxisPrivate::QBarCategoryAxisPrivate(QBarCategoryAxis *q) | ||
: QAbstractAxisPrivate(q), | ||||
m_min(0.0), | ||||
m_max(0.0), | ||||
m_count(0) | ||||
|
r1613 | { | ||
} | ||||
|
r1808 | QBarCategoryAxisPrivate::~QBarCategoryAxisPrivate() | ||
|
r1613 | { | ||
} | ||||
|
r1808 | void QBarCategoryAxisPrivate::setMin(const QVariant &min) | ||
|
r1613 | { | ||
|
r2097 | setRange(min, m_maxCategory); | ||
|
r1613 | } | ||
|
r1808 | void QBarCategoryAxisPrivate::setMax(const QVariant &max) | ||
|
r1613 | { | ||
|
r2097 | setRange(m_minCategory, max); | ||
|
r1613 | } | ||
|
r1808 | void QBarCategoryAxisPrivate::setRange(const QVariant &min, const QVariant &max) | ||
|
r1613 | { | ||
QString value1 = min.toString(); | ||||
QString value2 = max.toString(); | ||||
|
r2273 | setRange(value1, value2); | ||
|
r1613 | } | ||
|
r2273 | void QBarCategoryAxisPrivate::setRange(qreal min, qreal max) | ||
|
r1613 | { | ||
|
r1808 | Q_Q(QBarCategoryAxis); | ||
|
r1716 | |||
|
r2273 | bool categoryChanged = false; | ||
|
r1725 | bool changed = false; | ||
|
r1662 | |||
|
r2273 | if (min > max) | ||
return; | ||||
if (!qFuzzyIsNull(m_min - min)) { | ||||
m_min = min; | ||||
changed = true; | ||||
int imin = m_min + 0.5; | ||||
if (imin >= 0 && imin < m_categories.count()) { | ||||
QString minCategory = m_categories.at(imin); | ||||
if (m_minCategory != minCategory && !minCategory.isEmpty()) { | ||||
m_minCategory = minCategory; | ||||
categoryChanged = true; | ||||
emit q->minChanged(minCategory); | ||||
} | ||||
|
r1664 | } | ||
|
r2273 | |||
|
r1662 | } | ||
|
r2273 | |||
if (!qFuzzyIsNull(m_max - max)) { | ||||
m_max = max; | ||||
changed = true; | ||||
int imax = m_max - 0.5; | ||||
if (imax >= 0 && imax < m_categories.count()) { | ||||
QString maxCategory = m_categories.at(imax); | ||||
if (m_maxCategory != maxCategory && !maxCategory.isEmpty()) { | ||||
m_maxCategory = maxCategory; | ||||
categoryChanged = true; | ||||
emit q->maxChanged(maxCategory); | ||||
} | ||||
|
r1725 | } | ||
|
r1662 | } | ||
|
r2273 | if (categoryChanged){ | ||
|
r2097 | emit q->rangeChanged(m_minCategory, m_maxCategory); | ||
|
r2273 | } | ||
if (changed) { | ||||
emit rangeChanged(m_min,m_max); | ||||
} | ||||
|
r1613 | } | ||
|
r2273 | void QBarCategoryAxisPrivate::setRange(const QString &minCategory, const QString &maxCategory) | ||
{ | ||||
Q_Q(QBarCategoryAxis); | ||||
bool changed = false; | ||||
//special case in case or clearing all categories | ||||
if (minCategory.isNull() && maxCategory.isNull()) { | ||||
m_minCategory = minCategory; | ||||
m_maxCategory = maxCategory; | ||||
m_min = 0; | ||||
m_max = 0; | ||||
m_count = 0; | ||||
emit q->minChanged(minCategory); | ||||
emit q->maxChanged(maxCategory); | ||||
emit q->rangeChanged(m_minCategory, m_maxCategory); | ||||
emit rangeChanged(m_min,m_max); | ||||
} | ||||
if (m_categories.indexOf(maxCategory) < m_categories.indexOf(minCategory)) | ||||
return; | ||||
if (!minCategory.isEmpty() && m_minCategory != minCategory && m_categories.contains(minCategory)) { | ||||
m_minCategory = minCategory; | ||||
m_min = m_categories.indexOf(m_minCategory) - 0.5; | ||||
changed = true; | ||||
emit q->minChanged(minCategory); | ||||
} | ||||
if (!maxCategory.isEmpty() && m_maxCategory != maxCategory && m_categories.contains(maxCategory)) { | ||||
m_maxCategory = maxCategory; | ||||
m_max = m_categories.indexOf(m_maxCategory) + 0.5; | ||||
changed = true; | ||||
emit q->maxChanged(maxCategory); | ||||
} | ||||
if (changed) { | ||||
m_count = m_max - m_min; | ||||
emit q->rangeChanged(m_minCategory, m_maxCategory); | ||||
emit rangeChanged(m_min,m_max); | ||||
} | ||||
} | ||||
void QBarCategoryAxisPrivate::initializeGraphics(QGraphicsItem* parent) | ||||
|
r1613 | { | ||
|
r1808 | Q_Q(QBarCategoryAxis); | ||
|
r2273 | ChartAxis* axis(0); | ||
if (orientation() == Qt::Vertical) | ||||
axis = new ChartBarCategoryAxisY(q,parent); | ||||
if (orientation() == Qt::Horizontal) | ||||
axis = new ChartBarCategoryAxisX(q,parent); | ||||
m_item.reset(axis); | ||||
QAbstractAxisPrivate::initializeGraphics(parent); | ||||
|
r1613 | } | ||
|
r2121 | void QBarCategoryAxisPrivate::updateCategoryDomain() | ||
{ | ||||
m_min = m_categories.indexOf(m_minCategory) - 0.5; | ||||
m_max = m_categories.indexOf(m_maxCategory) + 0.5; | ||||
m_count = m_max - m_min; | ||||
} | ||||
|
r2275 | void QBarCategoryAxisPrivate::initializeDomain(AbstractDomain *domain) | ||
|
r1661 | { | ||
|
r1808 | Q_Q(QBarCategoryAxis); | ||
|
r2097 | if (m_max == m_min) { | ||
|
r1764 | int min; | ||
int max; | ||||
|
r2273 | if (orientation() == Qt::Vertical) { | ||
|
r1764 | min = domain->minY() + 0.5; | ||
max = domain->maxY() - 0.5; | ||||
|
r2097 | } else { | ||
|
r1764 | min = domain->minX() + 0.5; | ||
max = domain->maxX() - 0.5; | ||||
} | ||||
|
r2097 | if (min > 0 && min < m_categories.count() && max > 0 && max < m_categories.count()) | ||
q->setRange(m_categories.at(min), m_categories.at(max)); | ||||
} else { | ||||
|
r2273 | if (orientation() == Qt::Vertical) | ||
|
r1764 | domain->setRangeY(m_min, m_max); | ||
|
r2097 | else | ||
|
r1764 | domain->setRangeX(m_min, m_max); | ||
|
r1662 | } | ||
|
r1661 | } | ||
|
r1613 | |||
|
r1810 | #include "moc_qbarcategoryaxis.cpp" | ||
#include "moc_qbarcategoryaxis_p.cpp" | ||||
|
r1613 | |||
QTCOMMERCIALCHART_END_NAMESPACE | ||||