Skip to content

Commit

Permalink
fix(graph): drawing function was inconsistend and failed sometimes (d…
Browse files Browse the repository at this point in the history
…iv by 0)
  • Loading branch information
PlexSheep committed Jan 9, 2025
1 parent 8f04947 commit 419b2b6
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/analyze/graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ pub fn draw_checks(checks: &[Check], file: impl AsRef<Path>) -> Result<(), Analy
let mut data: Vec<(DateTime<Local>, Severity)> = Vec::new();
let time_grouped = group_by_time(checks.iter());
assert!(!time_grouped.is_empty());
let times: Vec<_> = time_grouped.values().collect();
let mut times: Vec<_> = time_grouped.values().collect();
times.sort();
let timespan =
times.first().unwrap()[0].timestamp_parsed()..times.last().unwrap()[0].timestamp_parsed();
let mut x_axis: Vec<_> = Vec::new();
Expand Down Expand Up @@ -50,12 +51,9 @@ pub fn draw_checks(checks: &[Check], file: impl AsRef<Path>) -> Result<(), Analy
reason: e.to_string(),
})?;

// FIXME: sometimes deeper div by 0 error
chart
.configure_mesh()
// .disable_x_mesh()
// .disable_y_mesh()
.x_labels(20)
.x_labels(10)
.max_light_lines(4)
.y_desc("Severity")
.x_desc("Time")
Expand Down

0 comments on commit 419b2b6

Please sign in to comment.