Radar graf: sprememba rotacije label in pomik grafa zaradi prekrivanja

This commit is contained in:
Miha 2021-04-29 09:50:04 +02:00
parent 27b920c868
commit f79d14894a

View File

@ -102,8 +102,8 @@ function (df, axistype = 0, seg = 4, pty = 16, pcol = 1:8, plty = 1:6,
if (!is.null(vlabels))
VLABELS <- vlabels
if (is.null(vlcex))
text(xx * 1.2, yy * 1.2, VLABELS, srt=45)
else text(xx * 1.2, yy * 1.2, VLABELS, cex = vlcex, srt=45)
text(xx * 1.2, yy * 1.2, VLABELS, srt=20)
else text(xx * 1.2, yy * 1.2, VLABELS, cex = vlcex, srt=20)
series <- length(df[[1]])
SX <- series - 2
if (length(pty) < SX) {
@ -253,7 +253,6 @@ data <-
#-------------------------- RADAR CHART -----------------------------#
CairoPNG(paste0('../../admin/survey/modules/mod_NIJZ/results/radar_', respondent_id, '.png'), width = 950, height = 750) # Export chart to png
# Create rang which will be labeld in grapf (10 likert scale)
myrange <- c(0, 7)
@ -269,7 +268,7 @@ labels <- gsub('(.{1,20})(\\s|$)', '\\1\n', data$V1)
colnames(mydf) <- labels
# Nastavitve fonta na željo naročnika
par(col="#004078", font = 2, cex = 0.7)
par(col="#004078", font = 2, cex = 0.8, mar=c(4,5,10,5))
# Plot a radar chart
radarchart2(
rev(mydf),