我有一個分析(見下文),我想使用我編寫的腳本來註釋特定圖表。 例如我想為XXX104和XXX107添加註解。 在這兩個圖表上,我將添加自訂圖形和文字來標識我想要引起注意的一組點。

使用命令“<<顯示樹結構”我可以識別具有每個圖表的框架框。 但是,我沒有看到與它們相關的圖表“名稱”。 例如,我希望能夠使用圖表名稱(例如 XXX107)作為查找來遍歷該樹並識別關聯的框架框(例如 FrameBox(7)),以便我可以引用它並以自動方式添加註釋。

事實上,在整個樹中,我沒有看到任何具有“圖表名稱”的“樹節點”,例如 XXX107
最終下圖是我想要實現的目標

這是我用來手動執行此操作的程式碼。 文件也已上傳。
我的問題是我無法弄清楚如何透過識別顯示樹中相應的「標題」來引用框架框。
乾杯,特洛伊
clearLog();
try(close(DT, noSave));
DT = open("PRE_CLEAN_DATA.jmp", invisible);
DT << newColumn("ENT_CLUSTER", character, nominal, formula(:ENTITY || "_" || :CLUSTER));
Plat = newWindow("CHART",
myGraphBox = DT << Graph Builder(
Size( 1446, 747 ),
Show Control Panel( 0 ),
Variables(
X( :WW ),
Y( :ENTITY_MEAN ),
Y( :GRAND_MEAN, Position( 1 ) ),
Wrap( :ENTITY ),
Color( :CLUSTER )
),
Elements(
Points( X, Y( 1 ), Y( 2 ), Legend( 23 ) ),
Smoother( X, Y( 1 ), Y( 2 ), Legend( 24 ) )
),
SendToReport(
Dispatch(
{},
"WW",
ScaleBox,
{Min( 202301.28 ), Max( 202320.72 ), Inc( 1 ), Minor Ticks( 1 ),
Label Row(
{Automatic Tick Marks( 0 ), Label Orientation( "Vertical" ),
Show Minor Ticks( 0 )}
)}
)
)
);
summarize(DT, clusters = by(:ENT_CLUSTER));
foreach({item}, clusters,
if(contains(item, "NON_CLUSTER"), continue());
ent = word(1, item, "_");
clust = word(2, item, "_");
write("Entity = " || ent || "\!n");
write("Cluster = " || clust || "\!n");
left = min(DT:WW[DT << getRowsWhere(:ENT_CLUSTER == item)]);
right = max(DT:WW[DT << getRowsWhere(:ENT_CLUSTER == item)]);
group_mean_min = min(DT:ENTITY_MEAN[DT << getRowsWhere(:ENT_CLUSTER == item)]);
group_mean_max = max(DT:ENTITY_MEAN[DT << getRowsWhere(:ENT_CLUSTER == item)]);
grand_mean_min = min(DT:GRAND_MEAN[DT << getRowsWhere(:ENT_CLUSTER == item)]);
grand_mean_max = max(DT:GRAND_MEAN[DT << getRowsWhere(:ENT_CLUSTER == item)]);
if(group_mean_min < grand_mean_min, bot = group_mean_min, bot = grand_mean_min);
if(group_mean_max > grand_mean_max, top = group_mean_max, top = grand_mean_max);
write("Left, Right, Top, Bot = " || char(left) || ", " || char(right) || ", " || char(top) || ", " || char(bot) || "\!n");
// ##########################################################
// ## This is what I want to do:
// ##########################################################
// 1. Traverse the graphbox tree
// 2. Identify Frame Box for each of the entities found
// 3. Get the Framebox Reference
// 4. Add my annotation.
// This is a manual Example I made using the show properties and tree structure commands
//myGraphBox << Show Properties();
//myGraphBox << Show tree structure();
rep = myGraphBox << report;
framebox = rep[frame box( 7 )];
framebox << Add Graphics Script(
penColor( "Black" );
fillcolor("Blue");
Transparency(0.1);
rect( left, top, right, bot, 0 );
rect( left, top, right, bot, 1 );
);
framebox << Add Graphics Script(
textSize(9);
textColor("Blue");
text( {left, top}, "Cluster 1" );
);
write("\!n");
);
);