cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Browse apps to extend the software in the new JMP Marketplace
Choose Language Hide Translation Bar

adding a table on the firts tab of a dashboard

Can i add in the first tab a table ?  like the example. 

Names Default To Here( 1 );

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );


// Create a table for the first tab
tableBox = dt << Summary(
    Group( :sex ),
    Mean( :weight ),
    Mean( :height ),
    N
);

gb_collector = Tab Box( "Dashboard",
    V List Box(
        tableBox
    )
	
);


For( i = 1, i <= 20, i++,
    // Column box for plot of all batches
    col1 = Col Box( "All Batches" || Char( i ) );

    // Create the first Graph Builder plot
    gb = Expr(
        dt << Graph Builder(
            invisible,
            Show Control Panel( 0 ),
            Variables( X( :weight ), Y( :height ), Overlay( :sex ) ),
            Elements( Points( X, Y, Legend( 9 ) ), Line Of Fit( X, Y, Legend( 11 ) ) )
        )
    );
    col1 << Append( gb );

    // Create column boxes for the Graph Builder plots
    col2 = Col Box( "Actual Data " || Char( i ) );
    col3 = Col Box( "Actual  " || Char( i ) );

    // Loop to create and append multiple Graph Builder plots to col2 and col3
    For( j = 1, j <= 2, j++,
        gbb = Expr(
            dt << Graph Builder(
                invisible,
                Show Control Panel( 0 ),
                Variables( X( :weight ), Y( :height ), Overlay( :sex ) ),
                Elements( Points( X, Y, Legend( 5 ) ), Line Of Fit( X, Y, Legend( 11 ) ) )
            )
        );
        col2 << Append( gbb );

        gbbb = Expr(
            dt << Graph Builder(
                invisible,
                Show Control Panel( 0 ),
                Variables( X( :weight ), Y( :height ), Overlay( :sex ) ),
                Elements( Points( X, Y, Legend( 9 ) ), Line Of Fit( X, Y, Legend( 11 ) ) )
            )
        );
        col3 << Append( gbbb );
    );

    // Create a tab for col1, col2, and col3 and append it to gb_collector
    tab = Tab Page Box( Char(i),
        V List Box(
            col1,
            H List Box( col2, col3 ) // Placing the two plots next to each other
        )
    );
    gb_collector << Append( tab );

);

gb_collector << Dockable( 1 );
gb_collector << Set Overflow Enabled( 1 );

nw = New Window( "Dashboard",
    gb_collector
);
1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: adding a table on the firts tab of a dashboard

You can for example use get as report

Names Default To Here(1);
New Window("Example",
	tb = Tab Box(
		Tab Page Box("First Tab", Tip("First Tab Tooltip"), Button Box("Press One")),
		Tab Page Box("Second Tab", Closeable(1), Button Box("Press Two")),
		Tab Page Box("Third Tab", Icon("Nominal"), Button Box("Press Three"))
	)
);
Wait(1);

dt = open("$SAMPLE_DATA/Big Class.jmp");

tb << Insert(1, Tab Page Box(Title("To first"), 
	dt << get as report
));
-Jarmo

View solution in original post

3 REPLIES 3
jthi
Super User

Re: adding a table on the firts tab of a dashboard

You can use Insert with Tab Box to determine into which position display box should be added

jthi_0-1726214720593.png

With index

Names Default To Here(1);
New Window("Example",
	tb = Tab Box(
		Tab Page Box("First Tab", Tip("First Tab Tooltip"), Button Box("Press One")),
		Tab Page Box("Second Tab", Closeable(1), Button Box("Press Two")),
		Tab Page Box("Third Tab", Icon("Nominal"), Button Box("Press Three"))
	)
);
Wait(1);
tb << Insert(1, Tab Page Box(Title("To first"), Button Box("Press Four")));

jthi_1-1726214743301.png

 

-Jarmo

Re: adding a table on the firts tab of a dashboard

thank you ! but the thing is that i am straggling printing the table on a tab. 

Names Default To Here( 1 );

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );


gb_collector = Tab Box();


For( i = 1, i <= 20, i++,
    // Column box for plot of all batches
    col1 = Col Box( "All Batches" || Char( i ) );

    // Create the first Graph Builder plot
    gb = Expr(
        dt << Graph Builder(
            invisible,
            Show Control Panel( 0 ),
            Variables( X( :weight ), Y( :height ), Overlay( :sex ) ),
            Elements( Points( X, Y, Legend( 9 ) ), Line Of Fit( X, Y, Legend( 11 ) ) )
        )
    );
    col1 << Append( gb );

    // Create column boxes for the Graph Builder plots
    col2 = Col Box( "Actual Data " || Char( i ) );
    col3 = Col Box( "Actual  " || Char( i ) );

    // Loop to create and append multiple Graph Builder plots to col2 and col3
    For( j = 1, j <= 2, j++,
        gbb = Expr(
            dt << Graph Builder(
                invisible,
                Show Control Panel( 0 ),
                Variables( X( :weight ), Y( :height ), Overlay( :sex ) ),
                Elements( Points( X, Y, Legend( 5 ) ), Line Of Fit( X, Y, Legend( 11 ) ) )
            )
        );
        col2 << Append( gbb );

        gbbb = Expr(
            dt << Graph Builder(
                invisible,
                Show Control Panel( 0 ),
                Variables( X( :weight ), Y( :height ), Overlay( :sex ) ),
                Elements( Points( X, Y, Legend( 9 ) ), Line Of Fit( X, Y, Legend( 11 ) ) )
            )
        );
        col3 << Append( gbbb );
    );

    // Create a tab for col1, col2, and col3 and append it to gb_collector
    tab = Tab Page Box( Char(i),
        V List Box(
            col1,
            H List Box( col2, col3 ) // Placing the two plots next to each other
        )
    );
    gb_collector << Append( tab );

);


// Create a table for the first tab
tableBox = Expr(dt << Summary(
    Group( :sex ),
    Mean( :weight ),
    Mean( :height ),
    N
));



// Create the "Results" tab
resultsTab = Tab Page Box("Results", tableBox);

// Insert the "Results" tab at the first position
gb_collector << Insert(1, resultsTab);


gb_collector << Dockable( 1 );
gb_collector << Set Overflow Enabled( 1 );

nw = New Window( "Dashboard",
    gb_collector
);
jthi
Super User

Re: adding a table on the firts tab of a dashboard

You can for example use get as report

Names Default To Here(1);
New Window("Example",
	tb = Tab Box(
		Tab Page Box("First Tab", Tip("First Tab Tooltip"), Button Box("Press One")),
		Tab Page Box("Second Tab", Closeable(1), Button Box("Press Two")),
		Tab Page Box("Third Tab", Icon("Nominal"), Button Box("Press Three"))
	)
);
Wait(1);

dt = open("$SAMPLE_DATA/Big Class.jmp");

tb << Insert(1, Tab Page Box(Title("To first"), 
	dt << get as report
));
-Jarmo