diff --git a/src/app/graph.rs b/src/app/graph.rs index cdbd212..c16fe56 100644 --- a/src/app/graph.rs +++ b/src/app/graph.rs @@ -27,7 +27,7 @@ impl Graph { pub fn update(&mut self, value: f32) { self.timeline.push_back(value); - if self.timeline.len() > 500 { + if self.timeline.len() > 1000 { self.timeline.pop_front(); } } @@ -53,7 +53,7 @@ impl canvas::Program for Graph { &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 y = bounds.height - value / 100. * bounds.height - 1.; + let y = bounds.height - value / 100. * bounds.height; builder.line_to(Point::new(x, y)) } }),