@nikles you are correct, the hover label functionality is based on interactivity. There are ways to trigger that using JSL (by moving the mouse, pausing, etc.) but that would add a lot of complexity to the solution that you really don't need.
Based on your reply to and the solution proposed by @txnelson, here is a script that will take you from the windows reference all the way down to the Graph Builder variable references.
Names Default to Here(1);
win = New Window("A Title", // Let's create a Window that contains a Graph Builder
Graph Builder( // with a LDF to make things interesting (multiple OutlineBoxes).
Size( 517, 448 ),
Show Control Panel( 0 ),
Variables( X( :sex ), Y( :height ) ),
Elements( Bar( X, Y, Legend( 6 ) ) ),
Local Data Filter(
Add Filter( columns( :height ), Where( :height >= 60.048 & :height <= 70 ) )
)
));
ob = win[OutlineBox("Graph Builder")]; // This is how you get the Display Box that contains the GB object
gbb = ob << Get Scriptable Object; // Now we extract the GB object from the Display Box
gb_expr = gbb << Get Script; // You could wrap in Char() to get the GB script as a string
gb_nargs = NArg(gb_expr); // and use pattern matching. Instead,
for(i = 1, i <= gb_nargs, i++, // let's see how to inspect it as an expression.
child = Arg(gb_expr, i);
If (HeadName(child) == "Variables",
var_nargs = NArg(child);
for(j = 1, j <= var_nargs, j++,
Show(Arg(child, j))
);
Break();
)
);
you should see:
Arg(child, j) = X(:sex);
Arg(child, j) = Y(:height);