Ich versuche seit einiger Zeit einen Code in JSL zu schreiben um die Legendenposition entsprechend dem Wert von uni_bat wie folgt zu verwalten.
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.
Wird nur eine Zeile wie "case for uni_bat==1" ausgeführt, wird der Graph problemlos erstellt.
Die IF-Anweisung wird jedoch im Diagrammgenerator nicht richtig erkannt.
Wie führt man die Zahlenfolge nach der Legendenposition mit IF-Anweisung richtig aus???
(Ex. {9,[0,-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], 10, [-1, -1, - 1, -1]} )
Q2.
Wenn Q1 gelöst ist, gibt es eine Möglichkeit, den mit der IF-Anweisung geschriebenen Code mit For Loop weiter zu vereinfachen?
So schreiben Sie Legend Position( )-Code regelmäßig bis uni_bat==50 mit for-Anweisung.
Für Anregungen wäre ich sehr dankbar. 