Subscribe Bookmark RSS Feed

how to determine number of inner positions used in a graph?




May 18, 2017



I dynamically add variables to a graph at runtime for specific roles and positions. I do not want to keep track of how many inner positions have been used by my script (makes things more complicated for me). However I do need this information. I would prefer to query the number of inner positions used instead.


I know how to query the number of (outer) positions that have been used but I do not know how to query the number of inner positions.


Is there a way to do this?


Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big" );

gb = Graph Builder(
	Automatic Recalc( 0 ),
	Variables( X( :age ), Y( :height ) ),
	Elements( Points( X, Y, Legend( 1 ) ), Smoother( X, Y, Legend( 2 ) ) )

// Add 'weight'
gbb = Report( gb )[Graph Builder Box( 1 )];
upper_graph_inner_pos = 2;
gbb << Add Variable({Column( "weight" ), Role( "Y" ), Position( 1 ), Inner Position( upper_graph_inner_pos )});

no_of_y_positions = gbb << Get N Positions("Y");


For( i = 1, i <= N Items( no_of_y_positions ), i++,
	no_of_inner_positions_at_y_pos = "no clue how to do this";