diff options
-rwxr-xr-x | test.r | 16 |
1 files changed, 13 insertions, 3 deletions
@@ -53,8 +53,6 @@ for (i in seq(1,nrow(solarEngine))) { } solarEngine <- solarEngineNew -print(solarEngine) - # Numerische Sensoren Lesen readNumericSensorDay <- function (sensorName) { d <- dbGetQuery(con, @@ -116,8 +114,20 @@ for (i in c(1:nrow(brenner))) { } # quick and dirty add solarEngine to plot + +rect_start <- 0 +rect_color <- rgb(255, 255, 0, alpha=40, maxColorValue=255) + for (i in c(1:nrow(solarEngine))) { - text(as.numeric(solarEngine$time[i]), max(data[2:length(data)],na.rm=TRUE)/2, paste("Solar Pumpe", solarEngine$value_int[i]), srt=90) + if (solarEngine$value_int[i] == 1) { + rect_start <- solarEngine$time[i]; + } else if (rect_start != 0) { + end <- solarEngine$time[i]; + # plot + rect(rect_start, 0, solarEngine$time[i], 100, col=rect_color,border=F) + beginn <- 0 + } + #text(as.numeric(solarEngine$time[i]), max(data[2:length(data)],na.rm=TRUE)/2, paste("Solar Pumpe", solarEngine$value_int[i]), srt=90) } rangeX <- as.POSIXct(range(data$time)) |