edited axis titles

This commit is contained in:
Ben Varick 2023-11-07 14:25:45 -06:00
parent 9812332051
commit aaaa55186c
Signed by: ben
SSH Key Fingerprint: SHA256:jWnpFDAcacYM5aPFpYRqlsamlDyKNpSj3jj+k4ojtUo
2 changed files with 15 additions and 9 deletions

File diff suppressed because one or more lines are too long

View File

@ -65,18 +65,24 @@ update_data <- function(){
scale_y_discrete(breaks = entities$entity_id, labels = entities$name) +
scale_x_datetime(date_breaks = "24 hours", date_labels = '%A', date_minor_breaks = "6 hours") +
theme(axis.text.x = element_text(angle = 30, vjust = 0.5)) +
labs(title = "The past week")
labs(title = "The past week",
x = NULL,
y = NULL,
fill = NULL)
plot_1day <- ggplot(data = values %>% filter(time >= max(values$time) - hours(24))) +
plot_1day <- ggplot(data = values %>% filter(time >= max(values$end_time) - hours(24))) +
geom_tile(aes(x = time + seconds(round(as.numeric(difftime(end_time, time, unit = "secs")))/2),
y = entity_id,
width = seconds(round(as.numeric(difftime(end_time, time, unit = "secs")))),
height = 0.5,
fill = status)) +
scale_y_discrete(breaks = entities$entity_id, labels = entities$name) +
scale_x_datetime(breaks = seq(round_date(max(values$time), "4 hours") - hours(24), round_date(max(values$time), "4 hours"), by = "4 hours"), date_labels = '%I:%M %p', date_minor_breaks = "1 hours") +
scale_x_datetime(breaks = seq(round_date(max(values$end_time), "4 hours") - hours(24), round_date(max(values$end_time), "4 hours"), by = "4 hours"), date_labels = '%I:%M %p', date_minor_breaks = "1 hours") +
theme(axis.text.x = element_text(angle = 30, vjust = 0.5)) +
labs(title = "Last 24 hours")
labs(title = "Last 24 hours",
x = NULL,
y = NULL,
fill = NULL)
render("laundry_status.Rmd",
output_dir = "html",