Description Usage Arguments Note See Also Examples
This function is designed to create the gantt chart which often used in progress control during projects.
1 2 3 |
rawdata |
A |
sort_by_works |
Boolean value, while true the rawdata will be sort by the column of works. |
colors.rect |
A named vector with length two, and the default value is
|
colors.bg |
A vector with length two, contains color values which controls the back groud color of the figure. |
size.plan |
Control the rect size which stands for time points in plan. |
size.real |
Control the rect size which stands for time points in real. |
type |
A character with values of 'plan' or 'real', only valid if the rawdata only have three columns. |
islegend |
Boolean value, draw legend or not, with default TRUE. |
legend.size |
|
If the rawdata contains five columns in the required format, then both
the planed work check points and real ones will be plot together. If only one
of them is needed then pass the correspond three columns(either be
c('works', 'start_time', 'end_time')
or be c('works',
'start_time_real', 'end_time_real')
) and change the value of type
accordingly.
Other figures: fig_waterfall
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 | rawdata <- data.frame(
works =
c('Requirements Analysis and Validation', 'Alogrithm 1', 'Alogrithm 2',
'Alogrithm 3', 'Build System Framwork', 'System Development',
'Data Base', 'System Deployment', 'Test Run', 'Acceptance'
),
start_time = as.Date(
c('2018-01-01', '2018-01-20','2018-02-15','2018-03-20', '2018-04-01',
'2018-05-01','2018-06-30','2018-08-01', '2018-09-01','2018-10-30')
),
end_time = as.Date(
c('2018-01-19', '2018-02-14', '2018-03-19', '2018-03-31', '2018-04-29',
'2018-06-29', '2018-07-31', '2018-08-31', '2018-10-29', '2018-11-08')
),
start_time_real = as.Date(
c('2018-01-02', '2018-01-21', '2018-02-17', '2018-03-25', '2018-04-01',
'2018-05-02', '2018-06-28', '2018-08-01', '2018-09-05', '2018-10-29')
),
end_time_real = as.Date(
c('2018-01-20', '2018-02-16', '2018-03-24', '2018-03-31', '2018-05-01',
'2018-06-27', '2018-07-31', '2018-09-04', '2018-10-28', '2018-11-07')
),
stringsAsFactors = FALSE
)
fig_gantt(rawdata)
fig_gantt(rawdata[, c('works', 'start_time', 'end_time')])
fig_gantt(rawdata[, c('works', 'start_time_real', 'end_time_real')],
type = 'real', colors.rect = 'red')
fig_gantt(rawdata[, c('works', 'start_time_real', 'end_time_real')],
type = 'real', colors.rect = 'red', islegend = FALSE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.