私はしばらくの間、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]} )} ),
Q1。
「caseforuni_bat == 1」のように1行だけ実行すれば、問題なくグラフが作成されます。
ただし、IFステートメントはグラフビルダーでは十分に認識されません。
IFステートメントを使用した凡例の位置に続く数字のシーケンスを適切に実行する方法???
(元。 {9、[0、-1、-1、-1、-1、-1、-1、-1、-1、-1、-1]、10、[-1、-1、- 1、-1]} )。
Q2。
もしもQ1が解決されましたが、Forループを使用してIFステートメントで記述されたコードをさらに単純化する方法はありますか?
forステートメントを使用してuni_bat == 50になるまで、Legend Position()コードを定期的に作成する方法。
何か提案をいただければ幸いです。 