こんにちは、
私の目標は、特定の列を見つけ、それらをグループ化してから、新しいデータテーブル(各グループを別々に)に積み重ね、次にLabelをXとして、グループ名をY軸として使用してグラフビルダーを使用して各グループをプロットすることです。
グループ化とスタック化はうまく機能していますが、グループ名を軸として使用してグラフビルダープロットをより大きなループに組み込む方法を判断するのは困難です。 ここでは、コミュニティでのさまざまな議論からコードの一部を見直して取りました。
グループ名を既知の列名に置き換えると、グラフビルダーのみが表示され、明らかに私が探しているプロットは表示されません。
Names Default To Here( 1 );
dt = Current Data Table();
start = Tick Seconds();
// Columns
list = List();
dt = Current Data Table();
list << Get Column Names();
col_names = dt << get column names( string );
number_columns = N Cols( dt );
dt << Reorder By Name;
// Containing Keyword Column Grouping
// Empty list to be populated with found columns
found_list = {};
// Name of the groups based on the keyword that I'll look for later
keyword_group_list = {"Ahh", "Now" };
// Loop over columns and create groups
For( i = 1, i <= N Items( keyword_group_list ), i++,
// Empty list to be populated with found columns. Get's emptied for every new group/ keyword.
found_list = {};
one_group = keyword_group_list[i];
// Loop over all column names, looking for ones that start with "Ahh", "Now", etc from keyword_group_list
// Once found put into array "found_list"
For( k = 1, k <= N Items( col_names ), k++,
If( Starts With( col_names[k], one_group ),
Insert Into( found_list, col_names[k] )
);
// Move each column group to the front in original data table
dt << Move Column Group( To First, one_group );
);
If( N Items( found_list ) > 0,
dt << group columns( one_group, found_list );
Wait( 0.25 );
stkdata = dt << Stack(
columns( dt << get column group( one_group ) ),
Keep(
:DEVICE_NAME,
:OTHER_INFO
),
Wait( 1.5 ),
Invisible,
Output Table( "Stacked " || one_group ),
/*stkdatatable = Current Data Table(),
Wait( 1.5 ),*/
/*
stkdatatable << Graph Builder(
Variables( X( :Label ), Y( :one_group ) ),
Elements( Points( X, Y, Legend( 3 ) ) )
),*/
);
);
);
end = Tick Seconds();
runtime = end - start;
このスクリプトのサンプルデータテーブルを提供できますか。