##// END OF EJS Templates
Renamed barcategory grephics item class which has been previously ommited
Marek Rosa -
r1918:a404d0b7b27f
parent child
Show More
@@ -28,17 +28,17 static int label_padding = 5;
28
28
29 QTCOMMERCIALCHART_BEGIN_NAMESPACE
29 QTCOMMERCIALCHART_BEGIN_NAMESPACE
30
30
31 ChartCategoriesAxisX::ChartCategoriesAxisX(QBarCategoryAxis *axis,ChartPresenter *presenter) : ChartAxis(axis,presenter),
31 ChartBarCategoryAxisX::ChartBarCategoryAxisX(QBarCategoryAxis *axis,ChartPresenter *presenter) : ChartAxis(axis,presenter),
32 m_categoriesAxis(axis)
32 m_categoriesAxis(axis)
33 {
33 {
34
34
35 }
35 }
36
36
37 ChartCategoriesAxisX::~ChartCategoriesAxisX()
37 ChartBarCategoryAxisX::~ChartBarCategoryAxisX()
38 {
38 {
39 }
39 }
40
40
41 QVector<qreal> ChartCategoriesAxisX::calculateLayout() const
41 QVector<qreal> ChartBarCategoryAxisX::calculateLayout() const
42 {
42 {
43 int count = m_categoriesAxis->d_ptr->count();
43 int count = m_categoriesAxis->d_ptr->count();
44
44
@@ -69,7 +69,7 QVector<qreal> ChartCategoriesAxisX::calculateLayout() const
69 return points;
69 return points;
70 }
70 }
71
71
72 QStringList ChartCategoriesAxisX::createCategoryLabels(const QVector<qreal>& layout) const
72 QStringList ChartBarCategoryAxisX::createCategoryLabels(const QVector<qreal>& layout) const
73 {
73 {
74 QStringList result;
74 QStringList result;
75 qreal d = (m_max - m_min)/m_rect.width();
75 qreal d = (m_max - m_min)/m_rect.width();
@@ -88,7 +88,7 QStringList ChartCategoriesAxisX::createCategoryLabels(const QVector<qreal>& lay
88 }
88 }
89
89
90
90
91 void ChartCategoriesAxisX::updateGeometry()
91 void ChartBarCategoryAxisX::updateGeometry()
92 {
92 {
93 const QVector<qreal>& layout = ChartAxis::layout();
93 const QVector<qreal>& layout = ChartAxis::layout();
94
94
@@ -148,7 +148,7 void ChartCategoriesAxisX::updateGeometry()
148 }
148 }
149 }
149 }
150
150
151 void ChartCategoriesAxisX::handleAxisUpdated()
151 void ChartBarCategoryAxisX::handleAxisUpdated()
152 {
152 {
153 if(m_categoriesAxis->categories()!=m_categories)
153 if(m_categoriesAxis->categories()!=m_categories)
154 {
154 {
@@ -38,11 +38,11 class QAbstractAxis;
38 class ChartPresenter;
38 class ChartPresenter;
39 class QBarCategoryAxis;
39 class QBarCategoryAxis;
40
40
41 class ChartCategoriesAxisX : public ChartAxis
41 class ChartBarCategoryAxisX : public ChartAxis
42 {
42 {
43 public:
43 public:
44 ChartCategoriesAxisX(QBarCategoryAxis *axis, ChartPresenter *presenter);
44 ChartBarCategoryAxisX(QBarCategoryAxis *axis, ChartPresenter *presenter);
45 ~ChartCategoriesAxisX();
45 ~ChartBarCategoryAxisX();
46
46
47 AxisType axisType() const { return X_AXIS;}
47 AxisType axisType() const { return X_AXIS;}
48
48
@@ -28,16 +28,16 static int label_padding = 5;
28
28
29 QTCOMMERCIALCHART_BEGIN_NAMESPACE
29 QTCOMMERCIALCHART_BEGIN_NAMESPACE
30
30
31 ChartCategoriesAxisY::ChartCategoriesAxisY(QBarCategoryAxis *axis,ChartPresenter *presenter) : ChartAxis(axis,presenter),
31 ChartBarCategoryAxisY::ChartBarCategoryAxisY(QBarCategoryAxis *axis,ChartPresenter *presenter) : ChartAxis(axis,presenter),
32 m_categoriesAxis(axis)
32 m_categoriesAxis(axis)
33 {
33 {
34 }
34 }
35
35
36 ChartCategoriesAxisY::~ChartCategoriesAxisY()
36 ChartBarCategoryAxisY::~ChartBarCategoryAxisY()
37 {
37 {
38 }
38 }
39
39
40 QVector<qreal> ChartCategoriesAxisY::calculateLayout() const
40 QVector<qreal> ChartBarCategoryAxisY::calculateLayout() const
41 {
41 {
42 int count = m_categoriesAxis->d_ptr->count();
42 int count = m_categoriesAxis->d_ptr->count();
43
43
@@ -68,7 +68,7 QVector<qreal> ChartCategoriesAxisY::calculateLayout() const
68 return points;
68 return points;
69 }
69 }
70
70
71 QStringList ChartCategoriesAxisY::createCategoryLabels(const QVector<qreal>& layout) const
71 QStringList ChartBarCategoryAxisY::createCategoryLabels(const QVector<qreal>& layout) const
72 {
72 {
73 QStringList result;
73 QStringList result;
74 qreal d = (m_max - m_min)/m_rect.height();
74 qreal d = (m_max - m_min)/m_rect.height();
@@ -86,7 +86,7 QStringList ChartCategoriesAxisY::createCategoryLabels(const QVector<qreal>& lay
86 return result;
86 return result;
87 }
87 }
88
88
89 void ChartCategoriesAxisY::updateGeometry()
89 void ChartBarCategoryAxisY::updateGeometry()
90 {
90 {
91 const QVector<qreal>& layout = ChartAxis::layout();
91 const QVector<qreal>& layout = ChartAxis::layout();
92
92
@@ -147,7 +147,7 void ChartCategoriesAxisY::updateGeometry()
147 }
147 }
148 }
148 }
149
149
150 void ChartCategoriesAxisY::handleAxisUpdated()
150 void ChartBarCategoryAxisY::handleAxisUpdated()
151 {
151 {
152
152
153 if(m_categoriesAxis->categories()!=m_categories)
153 if(m_categoriesAxis->categories()!=m_categories)
@@ -38,11 +38,11 class QAbstractAxis;
38 class QBarCategoryAxis;
38 class QBarCategoryAxis;
39 class ChartPresenter;
39 class ChartPresenter;
40
40
41 class ChartCategoriesAxisY : public ChartAxis
41 class ChartBarCategoryAxisY : public ChartAxis
42 {
42 {
43 public:
43 public:
44 ChartCategoriesAxisY(QBarCategoryAxis *axis, ChartPresenter *presenter);
44 ChartBarCategoryAxisY(QBarCategoryAxis *axis, ChartPresenter *presenter);
45 ~ChartCategoriesAxisY();
45 ~ChartBarCategoryAxisY();
46
46
47 AxisType axisType() const { return Y_AXIS;}
47 AxisType axisType() const { return Y_AXIS;}
48
48
@@ -446,9 +446,9 ChartAxis* QBarCategoryAxisPrivate::createGraphics(ChartPresenter* presenter)
446 {
446 {
447 Q_Q(QBarCategoryAxis);
447 Q_Q(QBarCategoryAxis);
448 if(m_orientation == Qt::Vertical){
448 if(m_orientation == Qt::Vertical){
449 return new ChartCategoriesAxisY(q,presenter);
449 return new ChartBarCategoryAxisY(q,presenter);
450 }else{
450 }else{
451 return new ChartCategoriesAxisX(q,presenter);
451 return new ChartBarCategoryAxisX(q,presenter);
452 }
452 }
453 }
453 }
454
454
@@ -70,8 +70,8 Q_SIGNALS:
70 private:
70 private:
71 Q_DECLARE_PRIVATE(QBarCategoryAxis)
71 Q_DECLARE_PRIVATE(QBarCategoryAxis)
72 Q_DISABLE_COPY(QBarCategoryAxis)
72 Q_DISABLE_COPY(QBarCategoryAxis)
73 friend class ChartCategoriesAxisX;
73 friend class ChartBarCategoryAxisX;
74 friend class ChartCategoriesAxisY;
74 friend class ChartBarCategoryAxisY;
75 };
75 };
76
76
77 QTCOMMERCIALCHART_END_NAMESPACE
77 QTCOMMERCIALCHART_END_NAMESPACE
General Comments 0
You need to be logged in to leave comments. Login now