Fix a bug, forgot one i++ in StatsPanel

Don't rotate labels if it's day number in StatsPanel
This commit is contained in:
Grégory Soutadé 2012-03-16 13:08:15 +01:00
parent 023786e680
commit f5f787aeec
1 changed files with 8 additions and 4 deletions

View File

@ -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);