From dcfa23e56a976bbf07a5fc9be706b6355f73ffe4 2012-05-22 13:08:26 From: sauimone Date: 2012-05-22 13:08:26 Subject: [PATCH] category fix to grouped, percent and stacked bar series --- diff --git a/src/barchart/qgroupedbarseries.cpp b/src/barchart/qgroupedbarseries.cpp index 1c6cdd6..ced1518 100644 --- a/src/barchart/qgroupedbarseries.cpp +++ b/src/barchart/qgroupedbarseries.cpp @@ -64,13 +64,14 @@ QAbstractSeries::SeriesType QGroupedBarSeries::type() const /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -QGroupedBarSeriesPrivate::QGroupedBarSeriesPrivate(/*QBarCategories categories,*/ QGroupedBarSeries *q) : QBarSeriesPrivate(/*categories,*/q) +QGroupedBarSeriesPrivate::QGroupedBarSeriesPrivate(QGroupedBarSeries *q) : QBarSeriesPrivate(q) { } void QGroupedBarSeriesPrivate::scaleDomain(Domain& domain) { + Q_Q(QGroupedBarSeries); qreal minX(domain.minX()); qreal minY(domain.minY()); qreal maxX(domain.maxX()); @@ -78,7 +79,7 @@ void QGroupedBarSeriesPrivate::scaleDomain(Domain& domain) int tickXCount(domain.tickXCount()); int tickYCount(domain.tickYCount()); - qreal x = m_categories.count(); + qreal x = q->categoryCount(); qreal y = maxCategorySum(); minX = qMin(minX, x); minY = qMin(minY, y); diff --git a/src/barchart/qpercentbarseries_p.h b/src/barchart/qpercentbarseries_p.h index d7494a9..f2c254d 100644 --- a/src/barchart/qpercentbarseries_p.h +++ b/src/barchart/qpercentbarseries_p.h @@ -39,7 +39,7 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE class QPercentBarSeriesPrivate: public QBarSeriesPrivate { public: - QPercentBarSeriesPrivate(/*QBarCategories categories,*/QPercentBarSeries* q); + QPercentBarSeriesPrivate(QPercentBarSeries* q); void scaleDomain(Domain& domain); Chart* createGraphics(ChartPresenter* presenter); diff --git a/src/barchart/qstackedbarseries.cpp b/src/barchart/qstackedbarseries.cpp index e518748..7c72dc3 100644 --- a/src/barchart/qstackedbarseries.cpp +++ b/src/barchart/qstackedbarseries.cpp @@ -71,6 +71,7 @@ QStackedBarSeriesPrivate::QStackedBarSeriesPrivate(QStackedBarSeries *q) : QBarS void QStackedBarSeriesPrivate::scaleDomain(Domain& domain) { + Q_Q(QStackedBarSeries); qreal minX(domain.minX()); qreal minY(domain.minY()); qreal maxX(domain.maxX()); @@ -78,7 +79,7 @@ void QStackedBarSeriesPrivate::scaleDomain(Domain& domain) int tickXCount(domain.tickXCount()); int tickYCount(domain.tickYCount()); - qreal x = m_categories.count(); + qreal x = q->categoryCount(); qreal y = maxCategorySum(); minX = qMin(minX, x); minY = qMin(minY, y); diff --git a/src/barchart/qstackedbarseries_p.h b/src/barchart/qstackedbarseries_p.h index 632de86..bf04717 100644 --- a/src/barchart/qstackedbarseries_p.h +++ b/src/barchart/qstackedbarseries_p.h @@ -39,7 +39,7 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE class QStackedBarSeriesPrivate: public QBarSeriesPrivate { public: - QStackedBarSeriesPrivate(/*QBarCategories categories,*/QStackedBarSeries* q); + QStackedBarSeriesPrivate(QStackedBarSeries* q); Chart* createGraphics(ChartPresenter* presenter); void scaleDomain(Domain& domain);