如何将列对话框列表用于列切换器?大家好,
我想创建一个脚本,在该脚本中,在列对话框中选择列列表,然后在图形生成器的列切换器中显示。
为了将脚本用于不同的数据表,列名是不确定的。我开始编写一小段代码,但是在此版本中,需要在关闭列对话框之后由用户手动选择“列切换器列”。 我对JSL并不陌生,希望能为解决该问题提供一些帮助。
Names Default to Here(1);
dt = Current Data Table() << Get Column Names;
cd = Column Dialog(
colx = ColList( "X", Max Col( 1 ), Modeling Type( "Continuous" ) ),
coly = ColList( "Y", Min Col( 1 ), Modeling Type( "Continuous" ) ),);
Graph Builder(
Size( 400, 300 ),
Show Control Panel( 0 ),
Variables( X( colx[1] ), Y( coly[1] ) ),
Elements( Line( X, Y, Legend( 3 ) ) ),
Column Switcher( coly[1] ) <BR />);
回复:如何将列对话框列表用于列切换器?列对话框需要一种独特的方法来从窗口中检索值。 以下脚本是对您在Column Switcher等中添加的脚本的重做。
Names Default To Here( 1 );
dt = Current Data Table() << Get Column Names;
cd = Column Dialog(
colx = ColList( "X", Max Col( 1 ), Modeling Type( "Continuous" ) ),
coly = ColList( "Y", Min Col( 1 ), Modeling Type( "Continuous" ) ),
);
colx = cd["colx"];
coly = cd["coly"];
Graph Builder(
Size( 400, 300 ),
Show Control Panel( 0 ),
Variables( X( colx[1] ), Y( coly[1] ) ),
Elements( Line( X, Y, Legend( 3 ) ) ),
Column Switcher( coly[1], coly )
);
回复:如何将列对话框列表用于列切换器?非常感谢Jim的迅速答复!您的解决方案运行完美:)