From 7777ba21b3a68c9e24f8f8977ce847802310341a 2012-03-13 12:57:53 From: Michal Klocek Date: 2012-03-13 12:57:53 Subject: [PATCH] Adds missing ticks hadnling --- diff --git a/src/axis/axisitem.cpp b/src/axis/axisitem.cpp index 367f95a..79b7281 100644 --- a/src/axis/axisitem.cpp +++ b/src/axis/axisitem.cpp @@ -95,6 +95,7 @@ QStringList AxisItem::createLabels(int ticks, qreal min, qreal max) const labels << QString::number(value); } else { + QString label = categories->label(value); labels << label; } @@ -370,19 +371,12 @@ void AxisItem::handleAxisUpdated() void AxisItem::handleRangeChanged(qreal min, qreal max,int tickCount) { + qDebug()<setTicksCount(m_ticksCount); -*/ + m_ticksCount= tickCount; if(isEmpty()) return; QVector layout = calculateLayout(); diff --git a/src/axis/qchartaxis.cpp b/src/axis/qchartaxis.cpp index 6977158..c5f6222 100644 --- a/src/axis/qchartaxis.cpp +++ b/src/axis/qchartaxis.cpp @@ -342,15 +342,10 @@ void QChartAxis::setRange(qreal min, qreal max) } if(changed) { - emit rangeChanged(m_min,m_max,m_ticksCount); + emit rangeChanged(m_min,m_max); } } -void QChartAxis::handleAxisRangeChanged(qreal min, qreal max) -{ - setRange(min,max); -} - /*! Sets \a count for ticks on the axis. */ @@ -358,7 +353,7 @@ void QChartAxis::setTicksCount(int count) { if(m_ticksCount!=count) { m_ticksCount=count; - emit rangeChanged(m_min,m_max,m_ticksCount); + emit ticksCountChanged(count); } } @@ -386,6 +381,17 @@ void QChartAxis::hide() emit updated(); } +void QChartAxis::handleAxisRangeChanged(qreal min, qreal max) +{ + qDebug()<<__FUNCTION__<