From f5f787aeec73a2d434036c035831787be0efd2ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9gory=20Soutad=C3=A9?= Date: Fri, 16 Mar 2012 13:08:15 +0100 Subject: [PATCH] Fix a bug, forgot one i++ in StatsPanel Don't rotate labels if it's day number in StatsPanel --- src/view/StatsPanel.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/view/StatsPanel.cpp b/src/view/StatsPanel.cpp index 441a2d1..96a26e8 100644 --- a/src/view/StatsPanel.cpp +++ b/src/view/StatsPanel.cpp @@ -255,7 +255,7 @@ void StatsPanel::UpdateStats(int monthFrom, int yearFrom, int monthTo, int yearT i=0; for (account = 0, i = 0, accountIt = user->_accounts.begin(); accountIt != user->_accounts.end(); - account++, accountIt++, i++) + account++, accountIt++) { if (_account->item(account)->checkState() != Qt::Checked) continue; @@ -340,9 +340,13 @@ void StatsPanel::UpdateStats(int monthFrom, int yearFrom, int monthTo, int yearT xAxis->setLabels(xlabels); xAxis->setShortLabels(xlabels); - KDChart::TextAttributes axisTextAttr(xAxis->textAttributes()); - axisTextAttr.setRotation(-60); - xAxis->setTextAttributes(axisTextAttr); + // Rotate only for months names + if (monthFrom != monthTo || yearFrom != yearTo) + { + KDChart::TextAttributes axisTextAttr(xAxis->textAttributes()); + axisTextAttr.setRotation(-60); + xAxis->setTextAttributes(axisTextAttr); + } _plot->lineDiagram()->addAxis(xAxis); _plot->lineDiagram()->addAxis(yAxis);