JMP does not have a built in chart to produce what you want. However, it does have the ability to modify default graphs to get what you want. So, the JSL I provided before, and have added more annotation to, and listed below uses the Graph Builder Platform, to create the general form for the required graph, but then the script adds graphics to it, that provides the desired results, and deletes the original results. In my first listing of the script, I just changed the bars produced by the original GB, to be displayed using white. However, I have changed that to just delete the original bars. The original bars is what you are seeing in the background of the chart.
Concerning the Legend, it needs to be created. You need to take on that challenge. First, you need to study the current script. Rea
Names Default To Here( 1 );
dt = Current Data Table();
// The Graph Builder Platform currently does not have the capability to create the
// needed Gantt like chart. The main issue is that it does not apppear that Graph
// Builder can display more than one Range Bar on a given line. If more than one
// range is input, then Graph Builder averages the start values and then averages
// the end values, and creates a range bar with the averaged values.
// However, Graph Builder does create a display window with the correct Axes etc.
// So the JSL below runs the Graph Builder Platform, and then adds the Gantt like
// bars, and then finally, deletes the original bars that Graph Builder created.
gb = Graph Builder(
Size( 1121, 626 ),
Show Control Panel( 0 ),
Variables(
X( :Start Date ),
X( :End Date, Position( 1 ) ),
Y( :Unit )
),
Elements( Bar( X( 1 ), X( 2 ), Y, Legend( 32 ), Bar Style( "Range" ) ) ),
SendToReport(
Dispatch(
{},
"Start Date",
ScaleBox,
{Min( 3790824458.85 ), Max( 3734876513.055 ), Interval( "Week" ), Inc( 1 ), Minor Ticks( 0 ),
Label Row( Label Orientation( "Angled" ) )}
),
Dispatch(
{},
"400",
ScaleBox,
{Legend Model(
32,
Level Name( 0, "Span of Task", Item ID( "Mean(Start Date)..Mean(End Date)", 1 ) )
)}
),
Dispatch( {}, "graph title", TextEditBox, {Set Text( "Gantt Chart" )} ),
Dispatch( {}, "X title", TextEditBox, {Set Text( "Date" )} ),
Dispatch( {}, "Y title", TextEditBox, {Set Text( "Tasks" )} )
)
);
// set axis values of the graph to make sure the complete date range is displayed
// Set the min date displayed to the earliest date - 5% of the overall range
// Set the max date displayed to the latest date + 5% of the overall range
offset = (Col Max( :end date ) - Col Min( :end date )) / 20;
gbr = gb << report;
gbr["Graph Builder", AxisBox( 1 )] << Min( Col Min( :start date ) - offset );
gbr["Graph Builder", AxisBox( 1 )] << Max( Col Max( :end date ) + offset );
// Add the color bars to the display
gbr["Graph Builder", FrameBox( 1 )] << Add Graphics Script(
// Get Category values
Summarize( dt, catGroups = by( :Category ) );
// Loop through each row in the data table and draw a filled rectangle on the
// display
For Each Row(
Fill Color( Contains( catGroups, :category ) + 2 );
Rect( :Start Date, Num( :unit ) - .9, :End Date, Num( :unit ) - 1.1, fill = 1 );
);
);
// Delete the bars created by Graph Builder
theBarSeg = gbr["Graph Builder", FrameBox( 1 )] << find seg( bar seg);
theBarSeg << delete;
d the Scripting Guide, and familiarize yourself with the Scripting Index. Then you can take on the building of the legend.
Jim