cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar
lala
Level VII

How to make multi-row dashboards with JSL?

I saved the script for manually creating the dashboard to the data table and closed the data table
Reopening the table and executing the script was unsuccessful.

Thanks Experts!

dt=Open("$SAMPLE_DATA/Big Class.jmp");
p1=dt<< Graph Builder(Transform Column("row",Formula(Row())),Size(500,100),Show Control Panel(0),Show Legend(0),Show Title(0),Show Footer(0),Show X Axis(0),Show Y Axis(0),Show X Axis Title(0),Show Y Axis Title(0),Variables(X(:row),Y(:height)),Elements(Line(X,Y,Legend(5))));
p2=dt<< Graph Builder(Transform Column("row",Formula(Row())),Size(500,100),Show Control Panel(0),Show Legend(0),Show Title(0),Show Footer(0),Show X Axis(0),Show Y Axis(0),Show X Axis Title(0),Show Y Axis Title(0),Variables(X(:row),Y(:weight)),Elements(Line(X,Y,Legend(5))));

2024-07-16_15-26-07.png

11 REPLIES 11
lala
Level VII

Re: How to make multi-row dashboards with JSL?

Yes, the expert's code has pretty much done the trick.
You just added the "height" column 10 times to the dashboard.

 

How do I write code if I want to add a total of 10 columns to the table, one by one, along with the new ones?That's the key.

 

As for the hidden text is secondary.


Thanks Experts!

jthi
Super User

Re: How to make multi-row dashboards with JSL?

Names Default To Here(1);

dt = Open("$SAMPLE_DATA/Big Class.jmp");
dt << New Column("col1", Numeric, Continuous, Set Formula(Col Shuffle()));
dt << New Column("col2", Numeric, Continuous, Set Formula(Col Shuffle()));
dt << New Column("col3", Numeric, Continuous, Set Formula(Col Shuffle()));
dt << New Column("col4", Numeric, Continuous, Set Formula(Col Shuffle()));
dt << New Column("col5", Numeric, Continuous, Set Formula(Col Shuffle()));
dt << New Column("col6", Numeric, Continuous, Set Formula(Col Shuffle()));
dt << New Column("col7", Numeric, Continuous, Set Formula(Col Shuffle()));
dt << New Column("col8", Numeric, Continuous, Set Formula(Col Shuffle()));

create_report = function({dt, colname}, {Default Local},
	gb = dt << Graph Builder(
		Transform Column("row", Formula(Row())),
		Size(500, 100),
		Show Control Panel(0),
		Show Legend(0),
		Show Title(0),
		Show Footer(0),
		Show X Axis(0),
		Show Y Axis(0),
		Show X Axis Title(0),
		Show Y Axis Title(0),
		Variables(X(:row), Y(Eval(colname))),
		Elements(Line(X, Y, Legend(5))),
		SendToReport(
			Dispatch({}, "Graph Builder", OutlineBox,
				{Set Title(""), Image Export Display(Normal)}
			)
		)
	);
	
	return(gb);
);

lub = Lineup Box(N Col(1));
cols = {"col1", "col2", "col3", "col4", "col5", "col6", "col7", "col8"};

For Each({colname}, cols,
	lub << Append(create_report(dt, colname));
);

nw = new window("",
	lub
);
-Jarmo