[apps/statistics] Clean code

This commit is contained in:
Léa Saviot
2020-02-10 14:00:41 +01:00
committed by Émilie Feral
parent 93d687abc2
commit 250f4ec3dd
4 changed files with 53 additions and 46 deletions

View File

@@ -43,8 +43,8 @@ double Store::heightOfBarAtIndex(int series, int index) const {
double Store::heightOfBarAtValue(int series, double value) const {
double width = barWidth();
int barNumber = std::floor((value - m_firstDrawnBarAbscissa)/width);
double lowerBound = m_firstDrawnBarAbscissa + barNumber*width;
double upperBound = m_firstDrawnBarAbscissa + (barNumber+1)*width;
double lowerBound = m_firstDrawnBarAbscissa + ((double)barNumber)*width;
double upperBound = m_firstDrawnBarAbscissa + ((double)(barNumber+1))*width;
return sumOfValuesBetween(series, lowerBound, upperBound);
}