The following R script can be used to embed a graphic representation of a daily calendar into a Zim page. The R script plugin must be enabled to use this script.
mtg.names <- c('Dummy meeting xyz', 'Dummy meeting abc', 'Dummy meeting pqr') start.times <- c(8, 10, 13) end.times <- c(8.5, 11, 14.5) # HEIGHT = 100 # WIDTH = 640 mtg.len <- end.times - start.times fill.times <- 17 - end.times times <- matrix(c(rev(start.times), rev(mtg.len), rev(fill.times)), byrow=TRUE, ncol=length(start.times)) par(oma=c(0,0,0,0), mar=c(2,12,0,0)) barplot(height=times, space=0, horiz=TRUE, names.arg=rev(mtg.names), las=1, col=c("white", "skyblue", "white"), xlim=c(8,18), xpd=FALSE, xaxp=c(8,17,9), xaxs="i", yaxs="i" ) abline(v=9:16) abline(v=seq(8.5,16.5,1), lty=2, col="gray25")
The first four lines of this script, specifying the meeting names, start and end times, and the figure height should be edited as necessary. If more space for meeting names is needed, the left margin specification of "12" on line 9 should be increased as needed. Depending on your monitor resolution and how much screen space you devote to Zim, you may also want to adjust the "WIDTH" specification on line 5; the value is in pixels.
This script produces a figure like this:
No comments:
Post a Comment