From 4b78a492d656eb5272e3c6309da0997d9b3866d9 Mon Sep 17 00:00:00 2001 From: Miha Date: Fri, 22 Oct 2021 14:47:40 +0200 Subject: [PATCH] =?UTF-8?q?Popravki=20razmikov=20in=20malo=20manj=C5=A1a?= =?UTF-8?q?=20pisava=20v=20grafu.=20NIJZ=20poro=C4=8Dilo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- admin/survey/modules/mod_NIJZ/R/Nijz_report.R | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/admin/survey/modules/mod_NIJZ/R/Nijz_report.R b/admin/survey/modules/mod_NIJZ/R/Nijz_report.R index a6687a6ee..69c038070 100644 --- a/admin/survey/modules/mod_NIJZ/R/Nijz_report.R +++ b/admin/survey/modules/mod_NIJZ/R/Nijz_report.R @@ -61,18 +61,24 @@ lxTranslate <- function(x, color = "NE", pisava = TRUE, pikaklicaj = FALSE) { x <- gsub(obarvajX, obarvajX_1, x, fixed=TRUE) } if (pisava == TRUE) { - val <- strsplit(x, "\\\\newline ")[[1]] + val <- strsplit(x, "\\\\newline ", fixed = T)[[1]] # val <- val[!c(seq_along(val) %% 2 == 0)] # Gledamo tretji odst <- val[4:length(val)] # Po drugem odstavku zmanjšamo pisavo na 9 - xsmall <- paste0("\\\\begin{footnotesize}", stringr::str_c(odst, collapse = "\\\\smallskip "), "\\\\end{footnotesize}") + xsmall <- paste0("\\\\newline \\\\begin{footnotesize}", stringr::str_c(odst, collapse = "\\\\smallskip "), "\\\\end{footnotesize}") - x <- paste0(stringr::str_c(val[1:4], collapse = "\\\\newline "),xsmall) + # Prvi del + t1 <- stringr::str_c(val[1:4], collapse = "\\\\newline ") - #x <- gsub("\\\\\\newline \\\\\\begin{footnotesize} ", "sd", x, fixed = T) + if(grepl("\\\\newline", substr(t1, nchar(t1)-10, nchar(t1))) == FALSE) { + t1 <- paste0( t1, "\\\\newline") + } + x <- paste0( t1,xsmall) + + } return(x) } @@ -354,7 +360,7 @@ colnames(mydf) <- labels #par(col="#004078", font = 2, cex = 1.4) -par(col="#004078", font = 2, cex = 1.2, xpd = TRUE) +par(col="#004078", font = 2, cex = 1.1, xpd = TRUE) # Plot a radar chart radarchart2( mydf,