I have some working scripts that manipulate a data table and create a graph..... all is well......
However, I'd like to accommodate changes in the data over time. For instance -- there are currently 5 levels of priority that can be reported in the database (i.e. Blocker, Critical, Major, Minor, Trivial) ---- but not all are used during every reporting period by the users (e.g. Critical, Major, Minor may be the only entries for a particular reporting period)..... it is very likely that users will include all (i.e. all 5) priorities in the future for a particular reporting period. Also --- it is likely that for the next reporting period the user's may only use 3 of the priority levels.
My dilemma --- my current graph script only accommodates a fixed number of priorities ---- so if I build it to only handle 4 then I may be excluding data on the graph ---- I have tried to force it to always show 5 priorities but it seems to mess up the legend (wrong order of labels/colors)........ Is there a way to make it dynamic depending on the data values to be used in the 'overlay'?
// Build the visualization Graph to show severity of open defects//
wind = New Window( "Open Defects by Severity",
Graph Builder(
Size( 570, 616 ),
Show Control Panel( 0 ),
Variables(
X( :Name( "Affects Version/s" ) ),
Group Y( :Open_Defects ),
Overlay( :Priority )
),
Elements(
Bar( X, Legend( 2 ), Bar Style( "Stacked" ), Summary Statistic( "N" ) )
),
SendToReport(
Dispatch(
{},
"Affects Version/s",
ScaleBox,
{Show Major Ticks( 0 ), Rotated Labels( "Automatic" )}
),
Dispatch(
{},
"400",
ScaleBox,
{Legend Model(
2,
Properties( 3, {Line Color( -10931939 ), Fill Color( -10931939 )} ),
Properties( 2, {Line Color( -2062516 ), Fill Color( -2062516 )} ),
Properties( 1, {Line Color( -11722634 ), Fill Color( -11722634 )} ),
Properties( 0, {Line Color( -3383340 ), Fill Color( -3383340 )} )
)}
),
Dispatch( {}, "400", LegendBox, {Position( {3, 2, 1, 0} )} )
)
)
);