diff --git a/src/axis/axis.pri b/src/axis/axis.pri index 1d79176..6f6b4fa 100644 --- a/src/axis/axis.pri +++ b/src/axis/axis.pri @@ -5,7 +5,10 @@ SOURCES += \ $$PWD/chartaxis.cpp \ $$PWD/chartaxisx.cpp \ $$PWD/chartaxisy.cpp \ -# $$PWD/qaxiscategories.cpp \ + $$PWD/chartvaluesaxisx.cpp \ + $$PWD/chartvaluesaxisy.cpp \ + $$PWD/chartcategoriesaxisx.cpp \ + $$PWD/chartcategoriesaxisy.cpp \ $$PWD/qcategoriesaxis.cpp \ $$PWD/qvaluesaxis.cpp \ $$PWD/qabstractaxis.cpp @@ -14,13 +17,15 @@ PRIVATE_HEADERS += \ $$PWD/chartaxis_p.h \ $$PWD/chartaxisx_p.h \ $$PWD/chartaxisy_p.h \ -# $$PWD/qaxiscategories_p.h \ + $$PWD/chartvaluesaxisx_p.h \ + $$PWD/chartvaluesaxisy_p.h \ + $$PWD/chartcategoriesaxisx_p.h \ + $$PWD/chartcategoriesaxisy_p.h \ $$PWD/qcategoriesaxis_p.h \ $$PWD/qvaluesaxis_p.h \ $$PWD/qabstractaxis_p.h -PUBLIC_HEADERS += \ -# $$PWD/qaxiscategories.h \ +PUBLIC_HEADERS += \ $$PWD/qcategoriesaxis.h \ $$PWD/qvaluesaxis.h \ $$PWD/qabstractaxis.h diff --git a/src/axis/chartcategoriesaxisx.cpp b/src/axis/chartcategoriesaxisx.cpp new file mode 100644 index 0000000..7aa9982 --- /dev/null +++ b/src/axis/chartcategoriesaxisx.cpp @@ -0,0 +1,122 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +#include "chartcategoriesaxisx_p.h" +#include "qabstractaxis.h" +#include "chartpresenter_p.h" +#include "chartanimator_p.h" +#include +#include +#include + +static int label_padding = 5; + +QTCOMMERCIALCHART_BEGIN_NAMESPACE + +ChartCategoriesAxisX::ChartCategoriesAxisX(QAbstractAxis *axis,ChartPresenter *presenter) : ChartAxis(axis,presenter) +{ +} + +ChartCategoriesAxisX::~ChartCategoriesAxisX() +{ +} + +QVector ChartCategoriesAxisX::calculateLayout() const +{ + Q_ASSERT(m_ticksCount>=2); + + QVector points; + points.resize(m_ticksCount); + + const qreal deltaX = m_rect.width()/(m_ticksCount-1); + for (int i = 0; i < m_ticksCount; ++i) { + int x = i * deltaX + m_rect.left(); + points[i] = x; + } + return points; +} + +void ChartCategoriesAxisX::updateGeometry() +{ + const QVector& layout = ChartAxis::layout(); + + m_minWidth = 0; + m_minHeight = 0; + + if(layout.isEmpty()) return; + + QStringList ticksList; + + bool categories = createLabels(ticksList,m_min,m_max,layout.size()); + + QList lines = m_grid->childItems(); + QList labels = m_labels->childItems(); + QList shades = m_shades->childItems(); + QList axis = m_axis->childItems(); + + Q_ASSERT(labels.size() == ticksList.size()); + Q_ASSERT(layout.size() == ticksList.size()); + + QGraphicsLineItem *lineItem = static_cast(axis.at(0)); + lineItem->setLine(m_rect.left(), m_rect.bottom(), m_rect.right(), m_rect.bottom()); + + qreal width = 0; + for (int i = 0; i < layout.size(); ++i) { + QGraphicsLineItem *lineItem = static_cast(lines.at(i)); + lineItem->setLine(layout[i], m_rect.top(), layout[i], m_rect.bottom()); + QGraphicsSimpleTextItem *labelItem = static_cast(labels.at(i)); + if (!categories || i<1) { + labelItem->setText(ticksList.at(i)); + const QRectF& rect = labelItem->boundingRect(); + QPointF center = rect.center(); + labelItem->setTransformOriginPoint(center.x(), center.y()); + labelItem->setPos(layout[i] - center.x(), m_rect.bottom() + label_padding); + + if(labelItem->pos().x()<=width){ + labelItem->setVisible(false); + lineItem->setVisible(false); + }else{ + labelItem->setVisible(true); + lineItem->setVisible(true); + width=rect.width()+labelItem->pos().x(); + } + m_minWidth+=rect.width(); + m_minHeight=qMax(rect.height(),m_minHeight); + } + else { + labelItem->setText(ticksList.at(i)); + const QRectF& rect = labelItem->boundingRect(); + QPointF center = rect.center(); + labelItem->setTransformOriginPoint(center.x(), center.y()); + labelItem->setPos(layout[i] - (layout[i] - layout[i-1])/2 - center.x(), m_rect.bottom() + label_padding); + m_minWidth+=rect.width(); + m_minHeight=qMax(rect.height()+label_padding,m_minHeight); + } + + if ((i+1)%2 && i>1) { + QGraphicsRectItem *rectItem = static_cast(shades.at(i/2-1)); + rectItem->setRect(layout[i-1],m_rect.top(),layout[i]-layout[i-1],m_rect.height()); + } + lineItem = static_cast(axis.at(i+1)); + lineItem->setLine(layout[i],m_rect.bottom(),layout[i],m_rect.bottom()+5); + } +} + +QTCOMMERCIALCHART_END_NAMESPACE diff --git a/src/axis/chartcategoriesaxisx_p.h b/src/axis/chartcategoriesaxisx_p.h new file mode 100644 index 0000000..626f1f9 --- /dev/null +++ b/src/axis/chartcategoriesaxisx_p.h @@ -0,0 +1,55 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +// W A R N I N G +// ------------- +// +// This file is not part of the QtCommercial Chart API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. + +#ifndef CHARTCATEGORIESAXISX_H +#define CHARTCATEGORIESAXISX_H + +#include "chartaxis_p.h" + +QTCOMMERCIALCHART_BEGIN_NAMESPACE + +class QAbstractAxis; +class ChartPresenter; + +class ChartCategoriesAxisX : public ChartAxis +{ +public: + ChartCategoriesAxisX(QAbstractAxis *axis, ChartPresenter *presenter); + ~ChartCategoriesAxisX(); + + AxisType axisType() const { return X_AXIS;} + +protected: + QVector calculateLayout() const; + void updateGeometry(); +}; + +QTCOMMERCIALCHART_END_NAMESPACE + +#endif /* CHARTCATEGORIESAXISX_H */ diff --git a/src/axis/chartcategoriesaxisy.cpp b/src/axis/chartcategoriesaxisy.cpp new file mode 100644 index 0000000..d04f8a2 --- /dev/null +++ b/src/axis/chartcategoriesaxisy.cpp @@ -0,0 +1,122 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +#include "chartcategoriesaxisy_p.h" +#include "qabstractaxis.h" +#include "chartpresenter_p.h" +#include "chartanimator_p.h" +#include +#include +#include + +static int label_padding = 5; + +QTCOMMERCIALCHART_BEGIN_NAMESPACE + +ChartCategoriesAxisY::ChartCategoriesAxisY(QAbstractAxis *axis,ChartPresenter *presenter) : ChartAxis(axis,presenter) +{ +} + +ChartCategoriesAxisY::~ChartCategoriesAxisY() +{ +} + +QVector ChartCategoriesAxisY::calculateLayout() const +{ + Q_ASSERT(m_ticksCount>=2); + + QVector points; + points.resize(m_ticksCount); + + const qreal deltaX = m_rect.width()/(m_ticksCount-1); + for (int i = 0; i < m_ticksCount; ++i) { + int x = i * deltaX + m_rect.left(); + points[i] = x; + } + return points; +} + +void ChartCategoriesAxisY::updateGeometry() +{ + const QVector& layout = ChartAxis::layout(); + + m_minWidth = 0; + m_minHeight = 0; + + if(layout.isEmpty()) return; + + QStringList ticksList; + + bool categories = createLabels(ticksList,m_min,m_max,layout.size()); + + QList lines = m_grid->childItems(); + QList labels = m_labels->childItems(); + QList shades = m_shades->childItems(); + QList axis = m_axis->childItems(); + + Q_ASSERT(labels.size() == ticksList.size()); + Q_ASSERT(layout.size() == ticksList.size()); + + QGraphicsLineItem *lineItem = static_cast(axis.at(0)); + lineItem->setLine(m_rect.left(), m_rect.bottom(), m_rect.right(), m_rect.bottom()); + + qreal width = 0; + for (int i = 0; i < layout.size(); ++i) { + QGraphicsLineItem *lineItem = static_cast(lines.at(i)); + lineItem->setLine(layout[i], m_rect.top(), layout[i], m_rect.bottom()); + QGraphicsSimpleTextItem *labelItem = static_cast(labels.at(i)); + if (!categories || i<1) { + labelItem->setText(ticksList.at(i)); + const QRectF& rect = labelItem->boundingRect(); + QPointF center = rect.center(); + labelItem->setTransformOriginPoint(center.x(), center.y()); + labelItem->setPos(layout[i] - center.x(), m_rect.bottom() + label_padding); + + if(labelItem->pos().x()<=width){ + labelItem->setVisible(false); + lineItem->setVisible(false); + }else{ + labelItem->setVisible(true); + lineItem->setVisible(true); + width=rect.width()+labelItem->pos().x(); + } + m_minWidth+=rect.width(); + m_minHeight=qMax(rect.height(),m_minHeight); + } + else { + labelItem->setText(ticksList.at(i)); + const QRectF& rect = labelItem->boundingRect(); + QPointF center = rect.center(); + labelItem->setTransformOriginPoint(center.x(), center.y()); + labelItem->setPos(layout[i] - (layout[i] - layout[i-1])/2 - center.x(), m_rect.bottom() + label_padding); + m_minWidth+=rect.width(); + m_minHeight=qMax(rect.height()+label_padding,m_minHeight); + } + + if ((i+1)%2 && i>1) { + QGraphicsRectItem *rectItem = static_cast(shades.at(i/2-1)); + rectItem->setRect(layout[i-1],m_rect.top(),layout[i]-layout[i-1],m_rect.height()); + } + lineItem = static_cast(axis.at(i+1)); + lineItem->setLine(layout[i],m_rect.bottom(),layout[i],m_rect.bottom()+5); + } +} + +QTCOMMERCIALCHART_END_NAMESPACE diff --git a/src/axis/chartcategoriesaxisy_p.h b/src/axis/chartcategoriesaxisy_p.h new file mode 100644 index 0000000..6e06dd0 --- /dev/null +++ b/src/axis/chartcategoriesaxisy_p.h @@ -0,0 +1,55 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +// W A R N I N G +// ------------- +// +// This file is not part of the QtCommercial Chart API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. + +#ifndef CHARTCATEGORIESAXISY_H +#define CHARTCATEGORIESAXISY_H + +#include "chartaxis_p.h" + +QTCOMMERCIALCHART_BEGIN_NAMESPACE + +class QAbstractAxis; +class ChartPresenter; + +class ChartCategoriesAxisY : public ChartAxis +{ +public: + ChartCategoriesAxisY(QAbstractAxis *axis, ChartPresenter *presenter); + ~ChartCategoriesAxisY(); + + AxisType axisType() const { return Y_AXIS;} + +protected: + QVector calculateLayout() const; + void updateGeometry(); +}; + +QTCOMMERCIALCHART_END_NAMESPACE + +#endif /* CHARTCATEGORIESAXISY_H */ diff --git a/src/axis/chartvaluesaxisx.cpp b/src/axis/chartvaluesaxisx.cpp new file mode 100644 index 0000000..f722376 --- /dev/null +++ b/src/axis/chartvaluesaxisx.cpp @@ -0,0 +1,122 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +#include "chartvaluesaxisx_p.h" +#include "qabstractaxis.h" +#include "chartpresenter_p.h" +#include "chartanimator_p.h" +#include +#include +#include + +static int label_padding = 5; + +QTCOMMERCIALCHART_BEGIN_NAMESPACE + +ChartValuesAxisX::ChartValuesAxisX(QAbstractAxis *axis,ChartPresenter *presenter) : ChartAxis(axis,presenter) +{ +} + +ChartValuesAxisX::~ChartValuesAxisX() +{ +} + +QVector ChartValuesAxisX::calculateLayout() const +{ + Q_ASSERT(m_ticksCount>=2); + + QVector points; + points.resize(m_ticksCount); + + const qreal deltaX = m_rect.width()/(m_ticksCount-1); + for (int i = 0; i < m_ticksCount; ++i) { + int x = i * deltaX + m_rect.left(); + points[i] = x; + } + return points; +} + +void ChartValuesAxisX::updateGeometry() +{ + const QVector& layout = ChartAxis::layout(); + + m_minWidth = 0; + m_minHeight = 0; + + if(layout.isEmpty()) return; + + QStringList ticksList; + + bool categories = createLabels(ticksList,m_min,m_max,layout.size()); + + QList lines = m_grid->childItems(); + QList labels = m_labels->childItems(); + QList shades = m_shades->childItems(); + QList axis = m_axis->childItems(); + + Q_ASSERT(labels.size() == ticksList.size()); + Q_ASSERT(layout.size() == ticksList.size()); + + QGraphicsLineItem *lineItem = static_cast(axis.at(0)); + lineItem->setLine(m_rect.left(), m_rect.bottom(), m_rect.right(), m_rect.bottom()); + + qreal width = 0; + for (int i = 0; i < layout.size(); ++i) { + QGraphicsLineItem *lineItem = static_cast(lines.at(i)); + lineItem->setLine(layout[i], m_rect.top(), layout[i], m_rect.bottom()); + QGraphicsSimpleTextItem *labelItem = static_cast(labels.at(i)); + if (!categories || i<1) { + labelItem->setText(ticksList.at(i)); + const QRectF& rect = labelItem->boundingRect(); + QPointF center = rect.center(); + labelItem->setTransformOriginPoint(center.x(), center.y()); + labelItem->setPos(layout[i] - center.x(), m_rect.bottom() + label_padding); + + if(labelItem->pos().x()<=width){ + labelItem->setVisible(false); + lineItem->setVisible(false); + }else{ + labelItem->setVisible(true); + lineItem->setVisible(true); + width=rect.width()+labelItem->pos().x(); + } + m_minWidth+=rect.width(); + m_minHeight=qMax(rect.height(),m_minHeight); + } + else { + labelItem->setText(ticksList.at(i)); + const QRectF& rect = labelItem->boundingRect(); + QPointF center = rect.center(); + labelItem->setTransformOriginPoint(center.x(), center.y()); + labelItem->setPos(layout[i] - (layout[i] - layout[i-1])/2 - center.x(), m_rect.bottom() + label_padding); + m_minWidth+=rect.width(); + m_minHeight=qMax(rect.height()+label_padding,m_minHeight); + } + + if ((i+1)%2 && i>1) { + QGraphicsRectItem *rectItem = static_cast(shades.at(i/2-1)); + rectItem->setRect(layout[i-1],m_rect.top(),layout[i]-layout[i-1],m_rect.height()); + } + lineItem = static_cast(axis.at(i+1)); + lineItem->setLine(layout[i],m_rect.bottom(),layout[i],m_rect.bottom()+5); + } +} + +QTCOMMERCIALCHART_END_NAMESPACE diff --git a/src/axis/chartvaluesaxisx_p.h b/src/axis/chartvaluesaxisx_p.h new file mode 100644 index 0000000..a0de635 --- /dev/null +++ b/src/axis/chartvaluesaxisx_p.h @@ -0,0 +1,55 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +// W A R N I N G +// ------------- +// +// This file is not part of the QtCommercial Chart API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. + +#ifndef CHARTVALUESAXISX_H +#define CHARTVALUESAXISX_H + +#include "chartaxis_p.h" + +QTCOMMERCIALCHART_BEGIN_NAMESPACE + +class QAbstractAxis; +class ChartPresenter; + +class ChartValuesAxisX : public ChartAxis +{ +public: + ChartValuesAxisX(QAbstractAxis *axis, ChartPresenter *presenter); + ~ChartValuesAxisX(); + + AxisType axisType() const { return X_AXIS;} + +protected: + QVector calculateLayout() const; + void updateGeometry(); +}; + +QTCOMMERCIALCHART_END_NAMESPACE + +#endif /* CHARTVALUESAXISX_H */ diff --git a/src/axis/chartvaluesaxisy.cpp b/src/axis/chartvaluesaxisy.cpp new file mode 100644 index 0000000..9a1aace --- /dev/null +++ b/src/axis/chartvaluesaxisy.cpp @@ -0,0 +1,122 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +#include "chartvaluesaxisy_p.h" +#include "qabstractaxis.h" +#include "chartpresenter_p.h" +#include "chartanimator_p.h" +#include +#include +#include + +static int label_padding = 5; + +QTCOMMERCIALCHART_BEGIN_NAMESPACE + +ChartValuesAxisY::ChartValuesAxisY(QAbstractAxis *axis,ChartPresenter *presenter) : ChartAxis(axis,presenter) +{ +} + +ChartValuesAxisY::~ChartValuesAxisY() +{ +} + +QVector ChartValuesAxisY::calculateLayout() const +{ + Q_ASSERT(m_ticksCount>=2); + + QVector points; + points.resize(m_ticksCount); + + const qreal deltaX = m_rect.width()/(m_ticksCount-1); + for (int i = 0; i < m_ticksCount; ++i) { + int x = i * deltaX + m_rect.left(); + points[i] = x; + } + return points; +} + +void ChartValuesAxisY::updateGeometry() +{ + const QVector& layout = ChartAxis::layout(); + + m_minWidth = 0; + m_minHeight = 0; + + if(layout.isEmpty()) return; + + QStringList ticksList; + + bool categories = createLabels(ticksList,m_min,m_max,layout.size()); + + QList lines = m_grid->childItems(); + QList labels = m_labels->childItems(); + QList shades = m_shades->childItems(); + QList axis = m_axis->childItems(); + + Q_ASSERT(labels.size() == ticksList.size()); + Q_ASSERT(layout.size() == ticksList.size()); + + QGraphicsLineItem *lineItem = static_cast(axis.at(0)); + lineItem->setLine(m_rect.left(), m_rect.bottom(), m_rect.right(), m_rect.bottom()); + + qreal width = 0; + for (int i = 0; i < layout.size(); ++i) { + QGraphicsLineItem *lineItem = static_cast(lines.at(i)); + lineItem->setLine(layout[i], m_rect.top(), layout[i], m_rect.bottom()); + QGraphicsSimpleTextItem *labelItem = static_cast(labels.at(i)); + if (!categories || i<1) { + labelItem->setText(ticksList.at(i)); + const QRectF& rect = labelItem->boundingRect(); + QPointF center = rect.center(); + labelItem->setTransformOriginPoint(center.x(), center.y()); + labelItem->setPos(layout[i] - center.x(), m_rect.bottom() + label_padding); + + if(labelItem->pos().x()<=width){ + labelItem->setVisible(false); + lineItem->setVisible(false); + }else{ + labelItem->setVisible(true); + lineItem->setVisible(true); + width=rect.width()+labelItem->pos().x(); + } + m_minWidth+=rect.width(); + m_minHeight=qMax(rect.height(),m_minHeight); + } + else { + labelItem->setText(ticksList.at(i)); + const QRectF& rect = labelItem->boundingRect(); + QPointF center = rect.center(); + labelItem->setTransformOriginPoint(center.x(), center.y()); + labelItem->setPos(layout[i] - (layout[i] - layout[i-1])/2 - center.x(), m_rect.bottom() + label_padding); + m_minWidth+=rect.width(); + m_minHeight=qMax(rect.height()+label_padding,m_minHeight); + } + + if ((i+1)%2 && i>1) { + QGraphicsRectItem *rectItem = static_cast(shades.at(i/2-1)); + rectItem->setRect(layout[i-1],m_rect.top(),layout[i]-layout[i-1],m_rect.height()); + } + lineItem = static_cast(axis.at(i+1)); + lineItem->setLine(layout[i],m_rect.bottom(),layout[i],m_rect.bottom()+5); + } +} + +QTCOMMERCIALCHART_END_NAMESPACE diff --git a/src/axis/chartvaluesaxisy_p.h b/src/axis/chartvaluesaxisy_p.h new file mode 100644 index 0000000..9f643cf --- /dev/null +++ b/src/axis/chartvaluesaxisy_p.h @@ -0,0 +1,55 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +// W A R N I N G +// ------------- +// +// This file is not part of the QtCommercial Chart API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. + +#ifndef CHARTVALUESAXISY_H +#define CHARTVALUESAXISY_H + +#include "chartaxis_p.h" + +QTCOMMERCIALCHART_BEGIN_NAMESPACE + +class QAbstractAxis; +class ChartPresenter; + +class ChartValuesAxisY : public ChartAxis +{ +public: + ChartValuesAxisY(QAbstractAxis *axis, ChartPresenter *presenter); + ~ChartValuesAxisY(); + + AxisType axisType() const { return Y_AXIS;} + +protected: + QVector calculateLayout() const; + void updateGeometry(); +}; + +QTCOMMERCIALCHART_END_NAMESPACE + +#endif /* CHARTVALUESAXISY_H */