Description Usage Arguments Details Value Examples
A Gantt chart is plotted using plotly. The format of the data.frame given to the function should be Task Start Duration Resource Task 1 2016-01-01 50 A Task 2 2016-02-20 25 B Task 3 2016-01-01 100 C Task 4 2016-04-10 60 C Task 5 2016-06-09 30 C Task 6 2016-04-10 150 A Task 7 2016-09-07 80 B Task 8 2016-11-26 10 B where the duration is given in days.
1 | plotGantt(mydf, client, brewerpalname = "Set3")
|
mydf |
the data.frame containing the information of the project |
client |
the client name given as a string |
brewerpalname |
the name of the palette to use from RColorBrewer which defaults to "Set3" |
Originally source appeared on https://www.r-bloggers.com/gantt-charts-in-r-using-plotly/.
a plotly object
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | tmpdf <- structure(list(
Task = c(
"Task 1", "Task 2", "Task 3", "Task 4",
"Task 5", "Task 6", "Task 7", "Task 8"
), Start = structure(c(
16801,
16851, 16801, 16901, 16961, 16901, 17051, 17131
), class = "Date"),
Duration = c(50L, 25L, 100L, 60L, 30L, 150L, 80L, 10L), Resource = c(
"A",
"B", "C", "C", "C", "A", "B", "B"
)
), .Names = c(
"Task", "Start",
"Duration", "Resource"
), row.names = c(NA, -8L), class = "data.frame")
plotGantt(tmpdf, "Sample Client")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.