Skip to content

Commit

Permalink
Minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcinusX committed Nov 13, 2017
1 parent b7a4db8 commit 0bf80c3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/widgets/progress_chart.dart
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ class ChartPainter extends CustomPainter {
}

void _drawBottomLabels(Canvas canvas, Size size) {
for (int line = 30; line >= 0; line -= 7) {
for (int line = ProgressChart.NUMBER_OF_DAYS - 1; line >= 0; line -= 7) {
double offsetX = leftOffsetStart + (drawingWidth / 30) * line;
ui.Paragraph paragraph = _buildParagraphForBottomLabel(line);
canvas.drawParagraph(
Expand Down Expand Up @@ -249,7 +249,7 @@ class ChartPainter extends CustomPainter {
.difference(beginningOfChart)
.inDays;
double xOffset = leftOffsetStart +
daysFromBeginning / (ProgressChart.NUMBER_OF_DAYS - 1) * drawingWidth;
daysFromBeginning / (ProgressChart.NUMBER_OF_DAYS) * drawingWidth;
double relativeYposition =
(entry.weight - minLineValue) / (maxLineValue - minLineValue);
double yOffset = 5 + drawingHeight - relativeYposition * drawingHeight;
Expand Down

0 comments on commit 0bf80c3

Please sign in to comment.