Last active
February 18, 2023 22:10
-
-
Save mmterpstra/fc432033204c3fe4ebc2696c1863730e to your computer and use it in GitHub Desktop.
Use R to generate your Burndown Charts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env R | |
#maye add commandline to script | |
#Yeah, it is a little low I know. | |
scrum.points=4 | |
scrum.startdate="2016/10/24" | |
scrum.sprint="93" | |
scrum.days=19 | |
scrum.pdf=paste('scrum',scrum.sprint,'.pdf') | |
#now with added weekends | |
d <- as.POSIXlt(as.Date(scrum.startdate) + seq(from=0,to=scrum.days-1)) | |
d <- as.Date(subset(d,d$wday < 6 & d$wday > 0)) | |
scrum.guide=scrum.points-seq(from=0,to=length(d)-1)/(length(d)-1)*scrum.points | |
pdf(file=scrum.pdf) | |
#more room for axis | |
par(mar=(c(7, 4, 4, 2) + 0.1)) | |
#initial plot for setting the plot limits and labels | |
plot(d,scrum.guide,type="l",lty=2, lwd=3,xaxt="n", col = 'gray',ylab="Scrum Points",xlab="", main=paste('Burndown for sprint ',scrum.spri$ | |
#grid over plot for easy manual drawing | |
abline(v = d, col = 'lightgray', lty = 3, lwd=2) | |
abline(h = seq(0, scrum.points,0.25), col = 'gray', lty = 3, lwd=c(3,1,1,1)) | |
#redraw lines because of ugly overlapping elements. | |
#note that the settings below should be changed in the plot function also | |
lines(d,scrum.guide,type='l', lty=2, lwd=3, col = 'gray') | |
axis.Date(1, at = seq(d[1], d[length(d)],1), labels = seq(d[1], d[length(d)],1), format= "%d/%m", las = 2) | |
#make dev.off() go silent | |
scrum.null <- dev.off() |
Hi, this line is OK?
plot(d,scrum.guide,type="l",lty=2, lwd=3,xaxt="n", col = 'gray',ylab="Scrum Points",xlab="", main=paste('Burndown for sprint ',scrum.spri$
Or i need change to:
plot(d, scrum.guide,type="l", lty=2, lwd=3, xaxt="n", col='gray', ylab="Scrum Points", xlab="", main=paste('Burndown for sprint', scrum.sprint))
By other side, i need this file: scrum.pdf? this is so, do you have the link?
Use your suggestion
plot(d, scrum.guide,type="l", lty=2, lwd=3, xaxt="n", col='gray', ylab="Scrum Points", xlab="", main=paste('Burndown for sprint', scrum.sprint))
When the code is ok it should produce a pdf file called scrum 93 .pdf
set on line 11 and used on line 18.
A better way is to edit line 11 to the example below
#this will result in an output file name scrum.93.pdf
scrum.pdf=paste(sep='.', 'scrum',scrum.sprint,'pdf')
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Latest example (output coverted with

pdftocairo
frompoppler-utils
):