Description Usage Arguments See Also Examples
View source: R/figure_event_storm.R
This function create a figure which discribes the time spent during different stages in different events.
1 2 3 |
rawdata |
A |
palette |
Character value, name of a palette. IF palette is given, the parameter colours won't be use. |
colours |
A vector gives out the colours. |
line.size |
Size of each event. |
angle |
Numeric value between 0 and |
expand |
Numeric value controls the space between start and end. |
isxtext |
Whether to add text at start positoion. |
hjust.xtext |
A numeric vector with length two, controls the position of text, only valid if isxtext is set to TRUE. |
islegend |
Whether to add legend to the figure. |
legend.size |
Size of legend key. |
Other figure: fig_bubble_rect
,
fig_calendar
, fig_event_line
,
fig_parallel
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | # build test data
step.num <- 7
num <- 40
base_time <- as.Date(
c('2018-01-01','2018-02-20', '2018-04-12', '2018-05-13','2018-06-30',
'2018-08-01', '2018-09-29', '2018-12-31')
)
biase <- sin(seq(0, 3, length.out = num))
start_time <- c()
end_time <- c()
for (i in 1:num) {
temp <- base_time[-1] + round(abs(rnorm(step.num, 20*biase[i], 0.2)))
temp <- c(base_time[1], temp)
start_time <- c(start_time, temp[1:step.num])
end_time <- c(end_time, temp[-1])
}
rawdata <- data.frame(
event_id = rep(1:num, each = step.num),
event_label = rep(1:num, each = step.num),
stage_label = rep(c(
'Requirements Analysis and Validation',
'Alogrithm', 'Build System Framwork', 'System Development',
'Data Base', 'System Deployment', 'Test Run'
), num),
start_time = start_time,
end_time = end_time,
stringsAsFactors = FALSE
)
head(rawdata)
# plot the figure
fig_event_storm(rawdata)
fig_event_storm(rawdata, islegend = FALSE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.