我一直在嘗試用 JSL 編寫代碼根據uni_bat的值來管理圖例位置如下。
Graph builder( ...,<BR /><BR />//If statement...
//if(
//N items(uni_bat) == 1, Dispatch( {}, "400", LegendBox, {Legend Position( {9, [0,-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], 10, [-1, -1, -1, -1]} )} ),
//N items(uni_bat) == 2, Dispatch( {}, "400", LegendBox, {Legend Position( {9, [0,1,-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], 10, [-1, -1, -1, -1]} )} ),
//N items(uni_bat) == 3, Dispatch( {}, "400", LegendBox, {Legend Position( {9, [0,1,2,-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], 10, [-1, -1, -1, -1]} )} ),
//N items(uni_bat) == 4, Dispatch( {}, "400", LegendBox, {Legend Position( {9, [0,1,2,3,-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], 10, [-1, -1, -1, -1]} )} ),
//N items(uni_bat) == 5, Dispatch( {}, "400", LegendBox, {Legend Position( {9, [0,1,2,3,4,-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], 10, [-1, -1, -1, -1]} )} ),
//N items(uni_bat) == 6, Dispatch( {}, "400", LegendBox, {Legend Position( {9, [0,1,2,3,4,5,-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], 10, [-1, -1, -1, -1]} )} ),
//N items(uni_bat) == 7, Dispatch( {}, "400", LegendBox, {Legend Position( {9, [0,1,2,3,4,5,6,-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], 10, [-1, -1, -1, -1]} )} ),
//N items(uni_bat) == 8, Dispatch( {}, "400", LegendBox, {Legend Position( {9, [0,1,2,3,4,5,6,7,-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], 10, [-1, -1, -1, -1]} )} ),
//N items(uni_bat) == 9, Dispatch( {}, "400", LegendBox, {Legend Position( {9, [0,1,2,3,4,5,6,7,8,-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], 10, [-1, -1, -1, -1]} )} ),
//N items(uni_bat) == 10, Dispatch( {}, "400", LegendBox, {Legend Position( {9, [0,1,2,3,4,5,6,7,8,9,-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], 10, [-1, -1, -1, -1]} )} ),
//N items(uni_bat) == 11, Dispatch( {}, "400", LegendBox, {Legend Position( {9, [0,1,2,3,4,5,6,7,8,9,10,-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], 10, [-1, -1, -1, -1]} )} ),
//N items(uni_bat) == 12, Dispatch( {}, "400", LegendBox, {Legend Position( {9, [0,1,2,3,4,5,6,7,8,9,10,11,-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], 10, [-1, -1, -1, -1]} )} )
//);\
// case for uni_bat == 1
Dispatch( {}, "400", LegendBox, {Legend Position( {9,[0,-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], 10, [-1, -1, -1, -1]} )} ),
一季度。
如果只執行一行,如“case for uni_bat==1”,則創建圖形沒有任何問題。
但是,IF 語句在圖形構建器中沒有得到很好的識別。
如何使用 IF 語句正確運行圖例位置後面的數字序列???
(前任。 {9,[0,-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], 10, [-1, -1, - 1, -1]} )
Q2。
如果第一季度解決了,有沒有辦法進一步簡化使用 For Loop 用 IF 語句編寫的代碼?
如何使用for語句定期編寫Legend Position()代碼直到uni_bat==50。
我將非常感謝您的任何建議。 