Function Resource

ProjectDataGanttChart

Plots Gantt charts for datasets with project data

ResourceFunction["ProjectDataGanttChart"][ds]

plots a Gantt chart for a project dataset ds.

ResourceFunction["ProjectDataGanttChart"] takes all options of TimelinePlot.
ResourceFunction["ProjectDataGanttChart"] expects datasets with column names "Group","Project","StartDate","EndDate".
If the column "Group" is not provided, then the column "Group" is added with all of its values being a generic group name.
If the column "Project" is not provided, then the column "Project" is added populated with generic project names. 
If ResourceFunction["ProjectDataGanttChart"] is given a numerical matrix with two columns, then that matrix is transformed into a dataset with columns "StartDate" and "EndDate".

Examples

Basic Examples (2) 

Here is a dataset with project data:

In[1]:=
SeedRandom[7];
dsData = ResourceFunction[
    "RandomTabularDataset"][{6, {"Group", "Project", "StartDate", "EndDate"}},
   "Generators" -> {
     "Group " <> ToString[#] & /@ Range[3],
     RandomWord,
     DateObject[DateList[#][[1 ;; 3]]] & /@ ResourceFunction["RandomDate"][#] &,
     DateObject[DateList[#][[1 ;; 3]]] & /@ ResourceFunction["RandomDate"][#] &
     }];
dsData = dsData[All, If[#StartDate > #EndDate, Join[#, <|"StartDate" -> #EndDate, "EndDate" -> #StartDate|>], #] &];
dsData[SortBy[{#Group, #StartDate, #EndDate} &]]
Out[4]=

Here is a Gantt chart:

In[5]:=
ResourceFunction[
CloudObject[
  "https://www.wolframcloud.com/obj/antononcube/DeployedResources/Function/ProjectDataGanttChart/index.html", Permissions -> "Public"]][dsData]
Out[5]=
In[6]:=
SeedRandom[1];
dsData = ResourceFunction[
    "RandomTabularDataset"][{4, {"Project", "StartDate", "EndDate"}},
   "Generators" -> {
     RandomWord,
     DateObject[DateList[#][[1 ;; 3]]] & /@ ResourceFunction["RandomDate"][#] &,
     DateObject[DateList[#][[1 ;; 3]]] & /@ ResourceFunction["RandomDate"][#] &
     }];
dsData = Sort@
  dsData[All, If[#StartDate > #EndDate, Join[#, <|"StartDate" -> #EndDate, "EndDate" -> #StartDate|>], #] &]
Out[8]=
In[9]:=
ResourceFunction[
CloudObject[
  "https://www.wolframcloud.com/obj/antononcube/DeployedResources/Function/ProjectDataGanttChart/index.html", Permissions -> "Public"]][dsData]
Out[9]=
In[10]:=
SeedRandom[66];
dsData = ResourceFunction[
    "RandomTabularDataset"][{4, {"Group", "StartDate", "EndDate"}},
   "Generators" -> {
     RandomWord[2],
     DateObject[DateList[#][[1 ;; 3]]] & /@ ResourceFunction["RandomDate"][#] &,
     DateObject[DateList[#][[1 ;; 3]]] & /@ ResourceFunction["RandomDate"][#] &
     }];
dsData = Sort@
  dsData[All, If[#StartDate > #EndDate, Join[#, <|"StartDate" -> #EndDate, "EndDate" -> #StartDate|>], #] &]
Out[12]=
In[13]:=
ResourceFunction[
CloudObject[
  "https://www.wolframcloud.com/obj/antononcube/DeployedResources/Function/ProjectDataGanttChart/index.html", Permissions -> "Public"]][dsData]
Out[13]=
In[14]:=
SeedRandom[46];
dsData = ResourceFunction[
    "RandomTabularDataset"][{4, {"StartDate", "EndDate"}},
   "Generators" -> {
     DateObject[DateList[#][[1 ;; 3]]] & /@ ResourceFunction["RandomDate"][#] &,
     DateObject[DateList[#][[1 ;; 3]]] & /@ ResourceFunction["RandomDate"][#] &
     }];
dsData = Sort@
  dsData[All, If[#StartDate > #EndDate, Join[#, <|"StartDate" -> #EndDate, "EndDate" -> #StartDate|>], #] &]
Out[16]=
In[17]:=
ResourceFunction[
CloudObject[
  "https://www.wolframcloud.com/obj/antononcube/DeployedResources/Function/ProjectDataGanttChart/index.html", Permissions -> "Public"]][dsData]
Out[17]=

Make a random matrix with tow columns and plot the Gantt chart for it:

In[18]:=
SeedRandom[33];
ResourceFunction[
CloudObject[
  "https://www.wolframcloud.com/obj/antononcube/DeployedResources/Function/ProjectDataGanttChart/index.html", Permissions -> "Public"]][
 RandomReal[{0, 100}, {12, 2}]]
Out[19]=

RandomTabularDataset takes all the options of TimelinePlot. Here is a project data dataset:

In[20]:=
SeedRandom[55];
dsData = ResourceFunction[
    "RandomTabularDataset"][{7, {"Group", "StartDate", "EndDate"}},
   "Generators" -> {
     RandomWord[3],
     NormalDistribution[10, 10],
     NormalDistribution[40, 30]
     }];
dsData = Sort@
  dsData[All, If[#StartDate > #EndDate, Join[#, <|"StartDate" -> #EndDate, "EndDate" -> #StartDate|>], #] &]
Out[22]=

Here is a Gantt chart with additional options:

In[23]:=
ResourceFunction[
CloudObject[
  "https://www.wolframcloud.com/obj/antononcube/DeployedResources/Function/ProjectDataGanttChart/index.html", Permissions -> "Public"]][dsData, Spacings -> 5, PlotStyle -> Directive[{Thickness[0.025], CapForm["Round"]}], PlotTheme -> "Business"]
Out[23]=

Here is a dataset with data for 64 projects:

In[24]:=
SeedRandom[32];
dsData = ResourceFunction[
    "RandomTabularDataset"][{64, {"Group", "Project", "StartDate", "EndDate"}},
   "Generators" -> {
     "Group " <> ToString[#] & /@ Range[8],
     RandomWord,
     DateObject[DateList[#][[1 ;; 3]]] & /@ ResourceFunction["RandomDate"][#] &,
     DateObject[DateList[#][[1 ;; 3]]] & /@ ResourceFunction["RandomDate"][#] &
     }];
dsData = dsData[All, If[#StartDate > #EndDate, Join[#, <|"StartDate" -> #EndDate, "EndDate" -> #StartDate|>], #] &];
dsData[SortBy[{#Group, #StartDate, #EndDate} &]];

Here is a dataset sample:

In[25]:=
SeedRandom[90];
RandomSample[dsData, 12]
Out[26]=

Here is a summary of the project data:

In[27]:=
ResourceFunction["RecordsSummary"][dsData]
Out[27]=

Here is the corresponding Gantt chart:

In[28]:=
ResourceFunction[
CloudObject[
  "https://www.wolframcloud.com/obj/antononcube/DeployedResources/Function/ProjectDataGanttChart/index.html", Permissions -> "Public"]][dsData, ImageSize -> 1000, AspectRatio -> 1, PlotStyle -> Directive[{Thickness[0.01], CapForm["Butt"]}]]
Out[28]=

Source Metadata