cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
JMP is taking Discovery online, April 16 and 18. Register today and join us for interactive sessions featuring popular presentation topics, networking, and discussions with the experts.
Choose Language Hide Translation Bar
twaintwist
Level III

Graph/Legend flexibility

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} )} )


       )


)


);


2265_01_Open Defects.jpg

11 REPLIES 11
XanGregg
Staff

Re: Graph/Legend flexibility

Looks like you did the hard part of getting the data into the right shape. If it's just the particular colors that need controlling, try using the Value Colors column property on each column (you can set them all at once with the Standardize Attributes menu item).

2304_ValueColorsEx.png

GoodMan
Level III

Re: Graph/Legend flexibility

Xam,

Thank you! Great help!

Kun