互動情節有人對如何建立互動式報告有任何想法嗎?
在報告中,我想在每個圖表中包含多條線的圖表。在視窗的左側,我想要一個行列表。當我單擊清單中的一條線時,我希望圖表中的所選線更加突出,而其餘線則淡出。
數據探索和視覺化回覆:互動情節左側有圖例可能有點棘手,但如果右側沒問題,基本的圖形產生器應該就夠了

https://www.jmp.com/support/help/en/18.0/#page/jmp/graph-builder.shtml#
回覆:互動情節你好!我已經使用 for 循環使用圖形生成器創建多個圖形。現在,我想將所有這些圖形分組到一張紙上,並建立一個互動式介面,供使用者與所有圖形一起互動。有辦法實現這一點嗎?謝謝你!
回覆:互動情節只使用基本的圖形產生器是個好主意,我只想在創建所有它們後將它們放在一起。
回覆:互動情節我需要更多資訊。例如,您可以將它們收集到 V 列錶框中,然後使用新視窗顯示
Names Default To Here(1);
dt = open("$SAMPLE_DATA/Big Class.jmp");
gb_collector = V List Box();
For(i = 1, i <= 3, i++,
gb_collector << Append(
dt << Graph Builder(
Variables(X(:weight), Y(:height), Overlay(:sex)),
Elements(Points(X, Y, Legend(9)), Line Of Fit(X, Y, Legend(11)))
)
)
);
nw = New Window("",
gb_collector
);
如果您正在使用 For 循環,我假設您正在編寫腳本。您是否曾經閱讀過腳本指南(例如https://www.jmp.com/support/help/en/18.0/#page/jmp/examples-of-creating-a-dashboard-from-two-reports.shtml# ) 。
回覆:互動情節我想將標籤頁框方法與for循環結合起來,但它不起作用。
這是我的腳本部分:
新視窗(“我的儀表板”,
H型分線盒(
尺寸(1000, 1000),
// 循環每個參數
For(i = 1, i <= N Items(numPar), i++,
// 用於繪製所有批次、實際資料和差異的列框
col1 = 列框(""),
col2 = Col Box(""),
col3 = 列框(""),
// 每個參數的選項卡頁框
標籤頁框(
Title(numPar[i] || " vs. 時間點"),
// 建立所有批次圖
gb = 圖形產生器(
尺寸(500, 500),
變數(X(:時間點月份), Y(:結果), 疊加(:批次)),
元素(點(X,Y))
),
// 本機篩選器:將批次設定為僅 cyc 中帶有 ref 的批次,而不是所有其他批次
gb << 本機資料過濾器(
無形的,
新增篩選器(列(:元件,:批次,:來源表),
其中(:Component == numPar[i]),
其中(:Batch == {cyc, bat}),
其中(:來源表== dt_name)
)
),
dt << 清除選擇(),
// 從圖表中刪除過濾器顯示
gb << 顯示控制面板(0),
// 更改繪圖的報告
gbb = 報告(gb)[GraphBuilderBox(1)],
// 新增線性迴歸
gbb << 新增元素(1, 1, {Type("擬合線"), X, Y, 擬合置信度(0), 方程式(0)}),
// 設定Y軸
minval = min(:Result[dt << 取得行 where(:Component == numPar[i] & :Batch == cyc & :來源表 == dt_name | :Batch == bat & :Component == numPar[i] & :源表== dt_name)]) * 0.95,
maxval = max(:Result[dt << 取得行 where(:Component == numPar[i] & :Batch == cyc & :來源表 == dt_name | :Batch == bat & :Component == numPar[i] & :源表== dt_name)]) * 1.05,
maxvalts = max(:時間點月份[dt << 取得行 where(:Component == numPar[i] & :Batch == cyc & :來源表 == dt_name | :Batch == bat & :Component == numPar[ i] & :源表== dt_name)]) * 1.05,
gbb[AxisBox(1)] << 分鐘(-0.1),
gbb[AxisBox(1)] << max(maxvalts),
gbb[AxisBox(2)] << min(minval),
gbb[AxisBox(2)] << max(maxval),
gbb[AxisBox(2)] << inc((maxval - minval) / 10),
// 設定Y軸標籤
unitList = 關聯數組(:結果單位[dt << 取得行 where(:Component == numPar[i] & :Batch == cyc & :來源表 == dt_name | :Batch == bat & :Component == numPar[ i] & :來源表== dt_name)]) << 刪除("") << 取得金鑰,
如果(N 項(單元列表)== 1,
gbb[文字編輯框(4)] << 設定文字(numPar[i] || " [" || unitList[1] || "]")
,
gbb[文字編輯框(4)] << 設定文字(numPar[i])
),
// 設定圖表標題
gbb[文字編輯框(1)] << 設定文字(numPar[i] || " vs. 時間點"),
// 追加
GBBA = 報告(GB),
col1 << 追加(gbba),
< )
)
),
< );
回覆:互動情節Names Default To Here(1);
dt = open("$SAMPLE_DATA/Big Class.jmp");
gb_collector = Tab Box(<< Set Style("Horizontal Spread"));
For(i = 1, i <= 3, i++,
gb_collector << Add("Title",
dt << Graph Builder(
Variables(X(:weight), Y(:height), Overlay(:sex)),
Elements(Points(X, Y, Legend(9)), Line Of Fit(X, Y, Legend(11)))
)
)
);
nw = New Window("",
gb_collector
);回覆:互動情節你有什麼 jmp 版本?在你的jmp中有效嗎?因為我使用上面的腳本沒有得到預期的輸出
回覆:互動情節我不知道你的預期輸出是什麼,我也沒有你的數據。腳本使用 Tab Box 收集 for 迴圈的結果

回覆:互動情節當我運行上面的腳本時,我有這個輸出。它和你不一樣
回覆:互動情節他們似乎在 JMP18 中改變了它。在 JMP17.2 中這似乎有效
Names Default To Here(1);
dt = open("$SAMPLE_DATA/Big Class.jmp");
gb_collector = Tab Box(<< Set Style("Horizontal Spread"));
For(i = 1, i <= 3, i++,
tab = Tab Page Box("",
gb = dt << Graph Builder(
Variables(X(:weight), Y(:height), Overlay(:sex)),
Elements(Points(X, Y, Legend(9)), Line Of Fit(X, Y, Legend(11)))
)
);
tab << Title("Title " || Char(i));
gb << title(Char(i));
gb_collector << Append(tab)
);
nw = New Window("",
gb_collector
);回覆:互動情節我想解決的另一個問題是,當我有大量標題很長的選項卡(例如 20 個)時,圖表會變得不成比例地大,從而很難清楚地觀察它們。我想將圖表調整為較小的比例,同時保留大標題和選項卡。是否可以將圖表放置在左側,右側留出空間?
回覆:互動情節我不確定「左邊的圖表,右邊的空白」是什麼意思。手動建立圖表,稍微調整其大小,複製腳本,它會告訴您如何為圖表添加大小。選項卡框還具有溢出和其他選項,您可以從腳本索引中找到這些選項

回覆:互動情節我想弄清楚是否有任何方法可以像此螢幕截圖一樣放置圖表。例如,先第一個圖,然後再將其他兩個圖放在一起。
回覆:互動情節您可以透過多種不同的方式組合例如 V 列錶框、H 列錶框、選項卡框、選項卡頁框來獲得您想要的版面配置。
您可以從腳本指南https://www.jmp.com/support/help/en/18.0/#page/jmp/construct-display-boxes-for-new-windows.shtml找到相當多的信息
Names Default To Here(1);
dt = open("$SAMPLE_DATA/Big Class.jmp");
gb_expr = Expr(dt << Graph Builder(
Show Control Panel(0),
Variables(X(:weight), Y(:height), Overlay(:sex)),
Elements(Points(X, Y, Legend(9)), Line Of Fit(X, Y, Legend(11)))
));
nw = New Window("",
V List Box(
gb_expr,
H List Box(
gb_expr,
gb_expr
)
)
);回覆:互動情節名稱預設為此處( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
gb_collector = 選項卡框( "儀表板" );
對於( i = 1, i <= 20, i++,
// 所有批次圖的列框
col1 = Col Box( "所有批次" || Char( i ) );
// 建立第一個圖形產生器圖
gb = 表達式(
dt << 圖形產生器(
無形的,
變項(X(:體重),Y(:身高),涵蓋(:性別)),
元素( 點( X, Y, 圖例( 9 ) ), 擬合線( X, Y, 圖例( 11 ) ) )
)
);
col1 << 追加( gb );
// 為兩個圖形產生器圖建立一個列框
col2 = Col Box("實際資料" || Char( i ) );
// 建立兩個圖形產生器圖並將其附加到 col2
對於( j = 1, j <= 2, j++,
gbb = 表達式(
dt << 圖形產生器(
無形的,
變項(X(:體重),Y(:身高),涵蓋(:性別)),
元素( 點( X, Y, 圖例( 9 ) ), 擬合線( X, Y, 圖例( 11 ) ) )
)
);
col2 << 追加( gbb );
);
// 為 col1 和 col2 建立一個選項卡並將其附加到 gb_collector
tab = 標籤頁框(" Something Something ",
V 列錶框(
第 1 列,
H List Box( col2 ) // 把兩個圖放在一起
)
);
gb_collector << 追加(選項卡);
// 設定gb的標題
gb << title("dxfkgbdlk,xfhglihxfd");
);
gb_collector << 可停靠( 1 );
gb_collector << 設定溢位啟用( 1 );
nw = 新視窗(“儀表板”,
gb_收集器
);
嘗試在我的腳本中使用上面的範例。但我沒有得到任何輸出。這是我的腳本:
當前資料表(dt);
dt << New column("時間點月數", Formula(Round(:時間點天數/30.438), 2));
gb_collector = 選項卡框();
For(i = 1, i <= N Items(numPar), i++,
// 所有批次圖的列框
col1 = Col Box("");
// 用於繪製實際資料的列框
col2 = Col Box("");
// 差異圖的列框
col3 = Col Box("");
//tab = 標籤頁框("",
gb = dt << 圖形產生器(
//無形的,
尺寸(700、400)、
變數(X(:時間點月份), Y(:結果), 疊加(:批次)),
元素(點(X,Y))
);
// 本機篩選器:將批次設定為僅 cyc 中帶有 ref 的批次,而不是所有其他批次
gb << 本機資料過濾器(
無形的,
新增篩選器(列(:元件,:批次,:來源表),
其中(:Component == numPar[i]),
其中(:Batch == {cyc, bat}),
其中(:來源表== dt_name)
)
);
dt << 清除選擇();
// 從圖表中刪除過濾器顯示
gb << 顯示控制面板(0);
// 更改繪圖的報告
gbb = 報告(gb)[GraphBuilderBox(1)];
// 新增線性迴歸
gbb << 加元素(1, 1, {Type("擬合線"), X, Y, 擬合置信度(0), 方程式(0)});
// 設定Y軸
minval = min(:Result[dt << 取得行 where(:Component == numPar[i] & :Batch == cyc & :來源表 == dt_name | :Batch == bat & :Component == numPar[i] & :源表== dt_name)]) * 0.95;
maxval = max(:Result[dt << 取得行 where(:Component == numPar[i] & :Batch == cyc & :來源表 == dt_name | :Batch == bat & :Component == numPar[i] & :源表== dt_name)]) * 1.05;
maxvalts = max(:時間點月份[dt << 取得行 where(:Component == numPar[i] & :Batch == cyc & :來源表 == dt_name | :Batch == bat & :Component == numPar[ i] & :源表== dt_name)]) * 1.05;
gbb[AxisBox(1)] << 分鐘(-0.1);
gbb[AxisBox(1)] << max(maxvalts);
gbb[AxisBox(2)] << min(minval);
gbb[AxisBox(2)] << max(maxval);
gbb[AxisBox(2)] << inc((maxval - minval) / 10);
// 設定Y軸標籤
unitList = 關聯數組(:結果單位[dt << 取得行 where(:Component == numPar[i] & :Batch == cyc & :來源表 == dt_name | :Batch == bat & :Component == numPar[ i] & :來源表== dt_name)]) << 刪除("") << 取得金鑰;
如果(N 項(單元列表)== 1,
gbb[文字編輯框(4)] << 設定文字(numPar[i] || " [" || unitList[1] || "]")
,
gbb[文字編輯框(4)] << 設定文字(numPar[i])
);
// 設定圖表標題
gbb[文字編輯框(1)] << Set text(numPar[i] || " vs. 時間點");
// 追加
//gbba = 報告(gb),
col1 << 追加(gb);
//過濾器<<關閉;
gb << 關閉視窗;
// 在參數循環中,我們現在也會循環批次
For(k = 1, k <= N 項( cyc ), k++,
check = dt << 取得行 where(:Component == numPar[i] & :Batch == cyc[k] & :來源表 == dt_name | :Batch == bat[k] & :Component == numPar[i ] & :來源表== dt_name);
if(N items(check) > 0, // 建立檢查以查看目前批次參數是否存在
// 建立基礎圖
gb = 圖形產生器(
//無形的,
尺寸(700、400)、
變數( X( :時間點月份 ), Y( :結果 ), 疊加( :批次 ) ),
元素(點(X,Y),)
);
gb << 本機資料過濾器(不可見,新增篩選器( columns( :Component, :Batch, :來源表),Where( :Component == numPar[i] ),Where( :Batch == {cyc[k ], bat [k]}),Where(:來源表==dt_name)));
dt << 清除選擇();
// 從圖表中刪除過濾器顯示
gb << 顯示控制台( 0 );
// 更改繪圖的報告
gbb = 報告( gb )[GraphBuilderBox( 1 )];
// 新增線性迴歸
gbb << 加元素( 1, 1, {Type( "擬合線" ), X, Y, 擬合信賴度( 0 ),方程式( 0 )} );
// 設定Y軸
minval = min(:Result[dt << 取得行 where(:Component == numPar[i] & :Batch == cyc[k] & :來源表 == dt_name | :Batch == bat[k] & :Component == numPar[i] & :來源表== dt_name)])*0.95;
maxval = max(:Result[dt << 取得行 where(:Component == numPar[i] & :Batch == cyc[k] & :來源表 == dt_name| :Batch == bat[k] & :Component == numPar[i] & :來源表== dt_name)])*1.05;
maxvalts = max(:時間點月份[dt << 取得行 where(:Component == numPar[i] & :Batch == cyc[k] & :來源表 == dt_name| :Batch == bat[k] & :元件== numPar[i] & :來源表== dt_name)])*1.05;
gbb[AxisBox(1)] << 分鐘(-0.1);
gbb[AxisBox(1)] << max(maxvalts);
gbb[AxisBox(2)] << min(minval);
gbb[AxisBox(2)] << max(maxval);
gbb[AxisBox(2)] << inc((maxval-minval)/10);
// 設定Y軸標籤
unitList = 關聯陣列( :Result Unit[dt << 取得行 where(:Component == numPar[i] & :Batch == cyc[k] & :來源表 == dt_name | :Batch == bat[k] & :Component == numPar[i] & :Source Table == dt_name)] ) << 刪除( "" ) << 取得鍵;
If( N 個項目( 單位列表 ) == 1,
gbb[文字編輯框( 4 )] << 設定文字( numPar[i] || " [" || unitList[1] || "]" )
);
If( N 個項目( 單位列表 ) != 1,
gbb[文字編輯框( 4 )] << 設定文字( numPar[i] )
);
// 設定圖表標題
gbb[文字編輯框( 1 )] << 設定文字( numPar[i] || " vs. 時間點 ");
// 追加
//gbba = 報告( gbb );
col2 << 追加( gbb );
//過濾器<<關閉;
gb << 關閉視窗;
// 開始第二個情節
gb2 = 圖形產生器(
//無形的,
尺寸(700、400)、
變數( X( 時間點月份 ), Y( :差異 ), 顏色( :批次 ) ),
元素(點(X,Y))
);
gb2 << 本機資料過濾器(不可見,新增篩選器( columns( :Component, :Batch, :來源表),Where(:Component == numPar[i] ),Where(:Batch == cyc[k] ),Where (:源表== dt5_name)));
dt4 << 清除選擇();
// 從圖表中刪除過濾器顯示
gb2 << 顯示控制台( 0 );
// 更改繪圖的報告
gbb2 = 報告( gb2 )[GraphBuilderBox( 1 )];
gbb2 << 加元素( 1, 1, {Type( "Line" ), X, Y} );
// 取得HC值
l_idx = dt4 << 取得行 where(dt4:Component == numPar[i] & :Batch == cyc[k]);
ul = min(dt4:HC[l_idx]);
如果(缺(ul),
if(min(:Difference[dt << 取得行 where(:Component == numPar[i] & :Batch == cyc[k] & :Source Table == dt5_name)]) == 0,
最小值=-5;
最大值 = 5,
minval = min(:Difference[dt << 取得行 where(:Component == numPar[i] & :Batch == cyc[k] & :Source Table == dt5_name)])*0.95;
maxval = max(:Difference[dt << 取得行 where(:Component == numPar[i] & :Batch == cyc[k] & :Source Table == dt5_name)])*1.05;
),
minval = min(:Difference[dt << 取得行 where(:Component == numPar[i] & :Batch == cyc[k] & :Source Table == dt5_name)],-ul)*1.05;
maxval = max(:Difference[dt << 取得行 where(:Component == numPar[i] & :Batch == cyc[k] & :Source Table == dt5_name)], ul)*1.05;
);
if(!ismissing(ul), //如果沒有 HC 值則不建立限制線
gbb2[AxisBox(2)] << 新增參考線(ul,"solid", black, char(round(ul,2)));
gbb2[AxisBox(2)] << 新增參考線(-ul,"solid", black, char(round(-ul,2)));
);
gbb2[AxisBox(2)] << 加參考線(0,"虛線");
gbb2[AxisBox(2)] << min(minval);
gbb2[AxisBox(2)] << max(maxval);
gbb2[AxisBox(2)] << inc((maxval-minval)/10);
//附加
//gbba2 = 報告( gbb2 );
col3 << 追加( gbba2 );
//過濾器<<關閉;
gb2 << 關閉視窗;
);
);
//);
tab = 標籤頁框(numPar[i],
V 列錶框(
第 1 列
H List Box( col2,col3 ) // 將兩個圖彼此相鄰放置
)
);
選項卡 << 標題(numPar[i]);
//gb << 標題(Char(1));
gb_collector << 附加(選項卡);
);
gb_collector << 可停靠( 1 );
gb_collector << 設定溢位啟用( 1 );
nw = 新視窗("我的儀表板",
gb_收集器
);
你能幫我看看該怎麼做嗎?
回覆:互動情節您必須退後一步並解釋您想要什麼:最好的情況是提供範例資料或使用 JMP 範例資料集之一來解釋您希望在盡可能小的範例中獲得什麼。
回覆:互動情節Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
gb_collector = Tab Box("Dashboard");
For(i = 1, i <= 20, i++,
// Column box for plot of all batches
col1 = Col Box("All Batches" || Char(i));
// Create the first Graph Builder plot
gb = Expr(
dt << Graph Builder(
invisible,
Variables(X(:weight), Y(:height), Overlay(:sex)),
Elements(Points(X, Y, Legend(9)), Line Of Fit(X, Y, Legend(11)))
)
);
col1 << Append(gb);
// Create a column box for the two Graph Builder plots
col2 = Col Box("Actual Data " || Char(i));
// Create and append two Graph Builder plots to col2
For(j = 1, j <= 2, j++,
gbb = Expr(
dt << Graph Builder(
invisible,
Variables(X(:weight), Y(:height), Overlay(:sex)),
Elements(Points(X, Y, Legend(9)), Line Of Fit(X, Y, Legend(11)))
)
);
col2 << Append(gbb);
);
// Create a tab for col1 and col2 and append it to gb_collector
tab = Tab Page Box(
" Something Something ",
V List Box(
col1,
H List Box(col2) // Placing the two plots next to each other
)
);
gb_collector << Append(tab);
// Set title for gb
gb << title("Title");
);
gb_collector << Dockable(1);
gb_collector << Set Overflow Enabled(1);
nw = New Window("Dashboard", gb_collector);
Here is the example that i use and i am trying to follow the same structure in my own script.回覆:互動情節當前資料表(dt);
dt << New column("時間點月數", Formula(Round(:時間點天數/30.438), 2));
gb_collector = 選項卡框();
For(i = 1, i <= N Items(numPar), i++,
// 所有批次圖的列框
col1 = Col Box("");
// 用於繪製實際資料的列框
col2 = Col Box("");
// 差異圖的列框
col3 = Col Box("");
//tab = 標籤頁框("",
gb = dt << 圖形產生器(
//無形的,
尺寸(700, 400),
變數(X(:時間點月份), Y(:結果), 疊加(:批次)),
元素(點(X,Y))
);
// 本機篩選器:將批次設定為僅 cyc 中帶有 ref 的批次,而不是所有其他批次
gb << 本機資料過濾器(
無形的,
新增篩選器(列(:元件,:批次,:來源表),
其中(:Component == numPar[i]),
其中(:批次== {cyc,bat}),
其中(:來源表== dt_name)
)
);
dt << 清除選擇();
// 從圖表中刪除過濾器顯示
gb << 顯示控制面板(0);
// 更改繪圖的報告
gbb = 報告(gb)[GraphBuilderBox(1)];
// 新增線性迴歸
gbb << 加元素(1, 1, {Type("擬合線"), X, Y, 擬合置信度(0), 方程式(0)});
// 設定Y軸
minval = min(:Result[dt << 取得行 where(:Component == numPar[i] & :Batch == cyc & :來源表 == dt_name | :Batch == bat & :Component == numPar[i] & :源表== dt_name)]) * 0.95;
maxval = max(:Result[dt << 取得行 where(:Component == numPar[i] & :Batch == cyc & :來源表 == dt_name | :Batch == bat & :Component == numPar[i] & :源表== dt_name)]) * 1.05;
maxvalts = max(:時間點月份[dt << 取得行 where(:Component == numPar[i] & :Batch == cyc & :來源表 == dt_name | :Batch == bat & :Component == numPar[ i] & :源表== dt_name)]) * 1.05;
gbb[AxisBox(1)] << 分鐘(-0.1);
gbb[AxisBox(1)] << max(maxvalts);
gbb[AxisBox(2)] << min(minval);
gbb[AxisBox(2)] << max(maxval);
gbb[AxisBox(2)] << inc((maxval - minval) / 10);
// 設定Y軸標籤
unitList = 關聯數組(:結果單位[dt << 取得行 where(:Component == numPar[i] & :Batch == cyc & :來源表 == dt_name | :Batch == bat & :Component == numPar[ i] & :來源表== dt_name)]) << 刪除("") << 取得金鑰;
如果(N 個項目(單元清單)== 1,
gbb[文字編輯框(4)] << 設定文字(numPar[i] || " [" || unitList[1] || "]")
,
gbb[文字編輯框(4)] << 設定文字(numPar[i])
);
// 設定圖表標題
gbb[文字編輯框(1)] << Set text(numPar[i] || " vs. 時間點");
// 追加
//gbba = 報告(gb),
col1 << 追加(gb);
//過濾器<<關閉;
gb << 關閉視窗;
// 在參數循環中,我們現在也會循環批次
For(k = 1, k <= N 項( cyc ), k++,
check = dt << 取得行 where(:Component == numPar[i] & :Batch == cyc[k] & :來源表 == dt_name | :Batch == bat[k] & :Component == numPar[i ] & :來源表== dt_name);
if(N items(check) > 0, // 建立檢查以查看目前批次參數是否存在
// 建立基礎圖
gb = 圖形產生器(
//無形的,
尺寸(700、400)、
變數( X( :時間點月份 ), Y( :結果 ), 疊加( :批次 ) ),
元素(點(X,Y),)
);
gb << 本機資料過濾器(不可見,新增篩選器( columns( :Component, :Batch, :來源表),Where( :Component == numPar[i] ),Where( :Batch == {cyc[k ], bat [k]}),Where(:來源表==dt_name)));
dt << 清除選擇();
// 從圖表中刪除過濾器顯示
gb << 顯示控制面板( 0 );
// 更改繪圖的報告
gbb = 報告( gb )[GraphBuilderBox( 1 )];
// 新增線性迴歸
gbb << 加元素( 1, 1, {Type( "擬合線" ), X, Y, 擬合置信度( 0 ),方程式( 0 )} );
// 設定Y軸
minval = min(:Result[dt << 取得行 where(:Component == numPar[i] & :Batch == cyc[k] & :來源表 == dt_name | :Batch == bat[k] & :Component == numPar[i] & :來源表== dt_name)])*0.95;
maxval = max(:Result[dt << 取得行 where(:Component == numPar[i] & :Batch == cyc[k] & :來源表 == dt_name| :Batch == bat[k] & :Component == numPar[i] & :來源表== dt_name)])*1.05;
maxvalts = max(:時間點月份[dt << 取得行 where(:Component == numPar[i] & :Batch == cyc[k] & :來源表 == dt_name| :Batch == bat[k] & :元件== numPar[i] & :來源表== dt_name)])*1.05;
gbb[AxisBox(1)] << 分鐘(-0.1);
gbb[AxisBox(1)] << max(maxvalts);
gbb[AxisBox(2)] << min(minval);
gbb[AxisBox(2)] << max(maxval);
gbb[AxisBox(2)] << inc((maxval-minval)/10);
// 設定Y軸標籤
unitList = 關聯陣列( :Result Unit[dt << 取得行 where(:Component == numPar[i] & :Batch == cyc[k] & :來源表 == dt_name | :Batch == bat[k] & :Component == numPar[i] & :Source Table == dt_name)] ) << 刪除( "" ) << 取得鍵;
If( N 個項目( 單位列表 ) == 1,
gbb[文字編輯框( 4 )] << 設定文字( numPar[i] || " [" || unitList[1] || "]" )
);
If( N 個項目( 單位列表 ) != 1,
gbb[文字編輯框( 4 )] << 設定文字( numPar[i] )
);
// 設定圖表標題
gbb[文字編輯框( 1 )] << 設定文字( numPar[i] || " vs. 時間點 ");
// 追加
//gbba = 報告( gbb );
col2 << 追加( gbb );
//過濾器<<關閉;
gb << 關閉視窗;
// 開始第二個情節
gb2 = 圖形產生器(
//無形的,
尺寸(700、400)、
變數( X( 時間點月份 ), Y( :差異 ), 顏色( :批次 ) ),
元素(點(X,Y))
);
gb2 << 本機資料過濾器(不可見,新增篩選器( columns( :Component, :Batch, :來源表),Where(:Component == numPar[i] ),Where(:Batch == cyc[k] ),Where (:源表== dt5_name)));
dt4 << 清除選擇();
// 從圖表中刪除過濾器顯示
gb2 << 顯示控制台( 0 );
// 更改繪圖的報告
gbb2 = 報告( gb2 )[GraphBuilderBox( 1 )];
gbb2 << 加元素( 1, 1, {Type( "Line" ), X, Y} );
// 取得HC值
l_idx = dt4 << 取得行 where(dt4:Component == numPar[i] & :Batch == cyc[k]);
ul = min(dt4:HC[l_idx]);
如果(缺(ul),
if(min(:Difference[dt << 取得行 where(:Component == numPar[i] & :Batch == cyc[k] & :Source Table == dt5_name)]) == 0,
最小值=-5;
最大值 = 5,
minval = min(:Difference[dt << 取得行 where(:Component == numPar[i] & :Batch == cyc[k] & :Source Table == dt5_name)])*0.95;
maxval = max(:Difference[dt << 取得行 where(:Component == numPar[i] & :Batch == cyc[k] & :Source Table == dt5_name)])*1.05;
),
minval = min(:Difference[dt << 取得行 where(:Component == numPar[i] & :Batch == cyc[k] & :Source Table == dt5_name)],-ul)*1.05;
maxval = max(:Difference[dt << 取得行 where(:Component == numPar[i] & :Batch == cyc[k] & :Source Table == dt5_name)], ul)*1.05;
);
if(!ismissing(ul), //如果沒有 HC 值則不建立限制線
gbb2[AxisBox(2)] << 新增參考線(ul,"solid", black, char(round(ul,2)));
gbb2[AxisBox(2)] << 新增參考線(-ul,"solid", black, char(round(-ul,2)));
);
gbb2[AxisBox(2)] << 加參考線(0,"虛線");
gbb2[AxisBox(2)] << min(minval);
gbb2[AxisBox(2)] << max(maxval);
gbb2[AxisBox(2)] << inc((maxval-minval)/10);
//附加
//gbba2 = 報告( gbb2 );
col3 << 追加( gbba2 );
//過濾器<<關閉;
gb2 << 關閉視窗;
);
);
//);
tab = 標籤頁框(numPar[i],
V 列錶框(
第 1 列
H List Box( col2,col3 ) // 將兩個圖彼此相鄰放置
)
);
選項卡 << 標題(numPar[i]);
//gb << 標題(Char(1));
gb_collector << 附加(選項卡);
);
gb_collector << 可停靠( 1 );
gb_collector << 設定溢位啟用( 1 );
nw = 新視窗("我的儀表板",
gb_收集器
);
這是我的腳本..
附件是我目前儀表板的螢幕截圖,其中包含 8 個圖表。以下是我組織這些圖表的具體要求:
- 保留第一張圖:我想保留第一張圖。
- 刪除第二個圖表:第二個圖表應從儀表板中刪除。
- 配對最後六個圖表:最後六個圖表應配對,以便每對並排顯示。具體來說,圖表應按如下方式組織:
- 第三張圖和第四張圖應相鄰顯示。
- 第五張圖和第六張圖應相鄰顯示。
- 第七張圖和第八張圖應相鄰顯示。
總而言之,最終佈局應包含第一個圖表,後面跟著三對圖表,每對圖表並排顯示。
回覆:互動情節這兩個腳本完全不同(也請對 JSL 程式碼使用 JSL 格式,這樣更容易閱讀)。你用 Col Box 做什麼?你要循環什麼(i 和 j)?是什麼決定了每個圖表包含哪些資訊?他們應該互相互動嗎?