diff --git a/src/app/graph.rs b/src/app/graph.rs index 8a3796a..79a96b7 100644 --- a/src/app/graph.rs +++ b/src/app/graph.rs @@ -35,7 +35,7 @@ impl canvas::Program for Graph { frame.stroke( &canvas::Path::new(|builder| { for (index, value) in self.timeline.iter().enumerate() { - let x = index as f32 / self.timeline.len() as f32 * bounds.width; + let x = index as f32 / (self.timeline.len() - 1) as f32 * bounds.width; let y = bounds.height - value / 100. * bounds.height; builder.line_to(Point::new(x, y)) }