diff options
Diffstat (limited to 'src/components/time_graph.rs')
-rw-r--r-- | src/components/time_graph.rs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/components/time_graph.rs b/src/components/time_graph.rs index 74589990..11527eb3 100644 --- a/src/components/time_graph.rs +++ b/src/components/time_graph.rs @@ -16,7 +16,7 @@ use unicode_segmentation::UnicodeSegmentation; use super::tui_widget::time_chart::{Axis, Dataset, TimeChart, DEFAULT_LEGEND_CONSTRAINTS}; /// A single graph point. -pub type Point = (f64, f64); +pub type Point = (f64, f64); // FIXME: Move this to tui time chart? /// Represents the data required by the [`TimeGraph`]. pub struct GraphData<'a> { @@ -70,9 +70,12 @@ impl<'a> TimeGraph<'a> { if self.hide_x_labels { Axis::default().bounds(adjusted_x_bounds) } else { + let xb_one = (self.x_bounds[1] / 1000).to_string(); + let xb_zero = (self.x_bounds[0] / 1000).to_string(); + let x_labels = vec![ - Span::raw(concat_string!((self.x_bounds[1] / 1000).to_string(), "s")), - Span::raw(concat_string!((self.x_bounds[0] / 1000).to_string(), "s")), + Span::raw(concat_string!(xb_one, "s")), + Span::raw(concat_string!(xb_zero, "s")), ]; Axis::default() |