diff options
Diffstat (limited to 'src/components/tui_widget/time_chart.rs')
-rw-r--r-- | src/components/tui_widget/time_chart.rs | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/components/tui_widget/time_chart.rs b/src/components/tui_widget/time_chart.rs index 605d13f8..c0aed91e 100644 --- a/src/components/tui_widget/time_chart.rs +++ b/src/components/tui_widget/time_chart.rs @@ -1,5 +1,8 @@ +mod canvas; + use std::{borrow::Cow, cmp::max}; +use canvas::*; use tui::{ buffer::Buffer, layout::{Constraint, Rect}, @@ -7,7 +10,7 @@ use tui::{ symbols::{self, Marker}, text::{Span, Spans}, widgets::{ - canvas::{Canvas, Line, Points}, + canvas::{Line, Points}, Block, Borders, GraphType, Widget, }, }; @@ -428,6 +431,13 @@ impl<'a> Widget for TimeChart<'a> { .y_bounds(self.y_axis.bounds) .marker(self.marker) .paint(|ctx| { + // Idea is to: + // - Go over all datasets, determine *where* a point will be drawn. + // - We take the topmost (last) point first. + // - After we determine all points, then we paint them all. + // This helps relieve the issue where normally, braille grids are painted via |=, when we want + // an exclusive replacement. + for dataset in &self.datasets { let color = dataset.style.fg.unwrap_or(Color::Reset); |