cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • JMP Security Notice: CVE-2026-109618 and CVE-2026-109619

    JMP promptly initiated a review of its products, services, and relevant infrastructure for exposure to CVE-2026-109618 and CVE-2026-109619.

    Our assessment of JMP products has not identified exposure to these vulnerabilities. Where remediation was required within supporting environments, appropriate security updates and controls have been applied and validated.

    We have identified no evidence of successful exploitation or unauthorized access to JMP systems or customer information associated with these vulnerabilities.

    JMP continues to monitor the issue and relevant vendor guidance. No action is required by JMP customers at this time.

  • Don’t miss your chance to experience Discovery Summit Europe at our best available rate! Early bird registration through 31 Oct.
  • Graph Builder Toolbar streamlines interactive graphing. Creates shortcuts on Report and GraphBuilder Helpers toolbars. Download and install the extension.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
BabyDoragon
Level IV

Handling Conditional Display of Y-Axis Variables in JSL for Graph Building

When using `graph built`, how can I describe the requirement in JSL that certain Y-axis variables, which may not always appear, should be displayed if they have values and not displayed if they have no values? The following two methods have not been effective.

 

1.

dt = Open("$SAMPLE_DATA/Big Class.jmp");
Graph Builder(
	Size( 534, 450 ),
	Show Control Panel( 0 ),
	Variables( X( :sex ), try(Y( :bbb )), Y( :height ), Y( :weight ) ),
	Elements( Position( 1, 1 ), Points( X, Y, Legend( 13 ) ) ),
	Elements( Position( 1, 2 ), Points( X, Y, Legend( 14 ) ) ),
	Elements( Position( 1, 3 ), Points( X, Y, Legend( 15 ) ) )
);

2.

dt = Open("$SAMPLE_DATA/Big Class.jmp");
Graph Builder(
	Size( 534, 450 ),
	Show Control Panel( 0 ),
	Variables( X( :sex ), Y( :bbb ), Y( :height ), Y( :weight ) ),
	Elements( Position( 1, 1 ), Points( X, Y, Legend( 13 ) ) ),
	Elements( Position( 1, 2 ), Points( X, Y, Legend( 14 ) ) ),
	Elements( Position( 1, 3 ), Points( X, Y, Legend( 15 ) ) )
);
1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: Handling Conditional Display of Y-Axis Variables in JSL for Graph Building

You can build the expression or add variable later

Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
gb = dt << Graph Builder(
	Size(534, 450),
	Show Control Panel(0),
	Variables(X(:sex), Y(:height), Y(:weight)),
	Elements(Position(1, 1), Points(X, Y, Legend(13))),
	Elements(Position(1, 2), Points(X, Y, Legend(14)))
);
dt << new column("A", Numeric, Continuous, Formula(Row()));

extra_cols = {"height", "A"};

For Each({extra_col}, extra_cols,
	Eval(EvalExpr(
		gb << Add Variable({Expr(NameExpr(AsColumn(dt, extra_col))), Role("Y")});
	));
);

Depending on what you are trying to do, there can be quite a few things to take into account (order, type of plots, legend, ...)

 

If I remember correctly this might have something related to this topic Scripters Club Recording: JSL in Graph Builder 

-Jarmo

View solution in original post

3 REPLIES 3

Re: Handling Conditional Display of Y-Axis Variables in JSL for Graph Building

Hi @BabyDoragon, is bbb a column that either exists or not and this is what we need to check, or bbb is always there but some values(rows) are missing ?

BabyDoragon
Level IV

Re: Handling Conditional Display of Y-Axis Variables in JSL for Graph Building

The default value of bbb is {}, and sometimes it may be stored as a variable, for example in the following two cases.

1.

dt = Open("$SAMPLE_DATA/Big Class.jmp");
bbb={};
bbb="age";
Graph Builder(
	Size( 534, 450 ),
	Show Control Panel( 0 ),
	Variables( X( :sex ), Y( as column(bbb)), Y( :height ), Y( :weight ) ),
	Elements( Position( 1, 1 ), Points( X, Y, Legend( 13 ) ) ),
	Elements( Position( 1, 2 ), Points( X, Y, Legend( 14 ) ) ),
	Elements( Position( 1, 3 ), Points( X, Y, Legend( 15 ) ) )
);

2.

dt = Open("$SAMPLE_DATA/Big Class.jmp");
bbb={};
//bbb="age";
Graph Builder(
	Size( 534, 450 ),
	Show Control Panel( 0 ),
	Variables( X( :sex ), Y( as column(bbb)), Y( :height ), Y( :weight ) ),
	Elements( Position( 1, 1 ), Points( X, Y, Legend( 13 ) ) ),
	Elements( Position( 1, 2 ), Points( X, Y, Legend( 14 ) ) ),
	Elements( Position( 1, 3 ), Points( X, Y, Legend( 15 ) ) )
);

I hope to enable the graph to automatically include or exclude this item based on whether there are any variables currently in bbb.

jthi
Super User

Re: Handling Conditional Display of Y-Axis Variables in JSL for Graph Building

You can build the expression or add variable later

Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
gb = dt << Graph Builder(
	Size(534, 450),
	Show Control Panel(0),
	Variables(X(:sex), Y(:height), Y(:weight)),
	Elements(Position(1, 1), Points(X, Y, Legend(13))),
	Elements(Position(1, 2), Points(X, Y, Legend(14)))
);
dt << new column("A", Numeric, Continuous, Formula(Row()));

extra_cols = {"height", "A"};

For Each({extra_col}, extra_cols,
	Eval(EvalExpr(
		gb << Add Variable({Expr(NameExpr(AsColumn(dt, extra_col))), Role("Y")});
	));
);

Depending on what you are trying to do, there can be quite a few things to take into account (order, type of plots, legend, ...)

 

If I remember correctly this might have something related to this topic Scripters Club Recording: JSL in Graph Builder 

-Jarmo

Recommended Articles