Hi @Rajat,
As @Mark_Bailey suggested, the Essentials of Graphing book is a great read and will explain in more detail this and other plots. But, I see there being two complexities in your plot that might take a little extra work, which is that you want a range area plot with steps not a polygon fill, and you want a column switcher operational for switching a pair of variables. Here's how I would approach this.
First, for the basic plot, you can accomplish this using the Bar element with a Range style. Here's what that will look like:
Here's a video showing the steps:
and the JSL, also saved to the attached table:
Graph Builder(
Show Control Panel( 0 ),
Show Legend( 0 ),
Graph Spacing( 10 ),
Variables(
X( :Subject ),
Y( :Name( "Min(Hours)" ) ),
Y( :Name( "Max(Hours)" ), Position( 1 ) ),
Group X( :School )
),
Elements( Bar( X, Y( 1 ), Y( 2 ), Legend( 4 ), Bar Style( "Range" ) ) ),
SendToReport(
Dispatch( {}, "graph title", TextEditBox, {Set Text( "Min and Max Hours by Subject and School" )} ),
Dispatch( {}, "Y title", TextEditBox, {Set Text( "Hours" )} ),
Dispatch( {}, "Graph Builder", FrameBox, {DispatchSeg( BarSeg( 1 ), Set Width Proportion( 1 ) )} ),
Dispatch( {}, "Graph Builder", FrameBox( 2 ), {DispatchSeg( BarSeg( 1 ), Set Width Proportion( 1 ) )} )
)
);
However, what you'll notice is that if you try to add a column switcher, you have the option to switch only one variable, but in your case, you need to switch out two, since that is what defines your range. You could add two Column Switchers, but I tend to not like that method, as it ends up looking like this, where you need to toggle two separate items:
You can make this plot work with a single Column Switcher-like operation, but need to do a little restructuring of your table via Tables > Stack. Here's how you will set that up:
This will give you the following table, which you will notice has taken your pairs of columns that represent the different outcome variable and stacked them on top of each other (and you'll see I had to use the multiple series stack here, series being the term for a set of columns that define a variable):
Now that we have that table, we can produce the plot as before (with the appropriate changes to which columns you use, since they're named differently now), and then, invoke not the column switcher, but the Local Data Filter, and pick either the Variable 1 or Variable 2 column (they're identical). Now, when you filter to show just one level of that variable you are showing just one pair of the outcome variables, thus a switch between Hours and Students:
I hope this helps
@julian