Here is a Graph Builder Bubble Chart using the Car Poll data, without creating a new data table. Instead, it uses a Transform variable created within the Graph Builder.
I created the chart interactively, and then used Save Script for the script below. I did add to the script the first 2 lines.
names default to here(1);
dt=open("$SAMPLE_DATA/Car Poll.jmp");
Graph Builder(
Size( 534, 450 ),
Show Control Panel( 0 ),
Variables(
X( :type ),
Y( :marital status ),
Overlay( :marital status ),
Size(
Transform Column(
"Count",
Formula( Col Number( :age, :marital status, :type ) )
),
Summary Statistic( "Mean" )
)
),
Elements( Points( X, Y, Legend( 8 ), Summary Statistic( "Mean" ) ) ),
SendToReport(
Dispatch(
{},
"400",
ScaleBox,
{Legend Model(
8,
Properties( 0, {Marker Size( 15 )}, Item ID( "Count", 1 ) ),
Properties( 1, {Line Color( 0 )}, Item ID( "Married", 1 ) ),
Properties( 2, {Line Color( 0 )}, Item ID( "Single", 1 ) )
)}
)
)
);
Jim