みなさん、こんにちは。
特定の変数のいくつかのバーを事前定義された塗りつぶしパターンで自動的に塗りつぶしたいと思います。ただし、変数の数は変化しているので、データテーブルに現在保存されている変数に応じて、繰り返し実行したいと思います。この場合、Fill Pattern()への引数をインデックス(機能しないように思われる)またはリストからの参照として提供する必要がありますが、そのためにはフィルパターンのリストが必要です。次に、リスト内のアイテムのインデックスを使用できます。それを行う方法を助けていただければ幸いです。
宜しくお願いします
Graph Builder(
Size( 734, 660 ),
Variables( //that would be good to have it in iteration
X( :Run ),
Y( :Param0 ),
Y( :Param1, Position( 2 ) ),
Y( :Param2, Position( 2 ) ),
Y( :Param3, Position( 2 ) ),
// there is much more of such variables to be displayed
),
Elements( Position( 1, 1 ), Points( X, Y, Legend( 455 ) ) ),
Elements( //that would be good to have it in iteration
Position( 1, 2 ),
Bar(
X,
Y( 3 ),
Y( 5 ),
Y( 6 ),
Y( 7 ),
Legend( 454 ),
Bar Style( "Stacked" )
)
),
SendToReport(
Dispatch(
{},
"400",
ScaleBox,
{Legend Model(
455,
Properties( 0, {Line Color( 25 )}, Item ID( "Param0", 1 ) )
), Legend Model(
454,
//that would be good to have it in iteration
Properties(
0,
{Fill Pattern( "left slant light" )},
Item ID( "Mittelwert(Param1)", 1 )
),
Properties(
2,
{Fill Pattern( "right slant light" )},
Item ID( "Mittelwert(Param2)", 1 )
),
Properties(
3,
{Fill Pattern( "grid heavy" )},
Item ID( "Mittelwert(Param3)", 1 )
),
// there is much more of such properties
)}
),
Dispatch( {}, "graph title", TextEditBox, {Set Text( "" )} ),
Dispatch(
{},
"400",
LegendBox,
{Legend Position(
{455, [0], 454, [10, -1, 1, 11]}
), Position(
{0, 10, -1, 1, 11}
)}
)
)
);
編集:
上記の問題を解決するために、データを渡すことができる式を使用しました。
「forループ」で棒グラフの凡例のプロパティを設定し、forループの前に定義されたlegend_model_exprに挿入したいと思いました。次に、その式をグラフビルダーの適切な場所に置き換えます。この場合、2つの問題が発生しました。まず、両方の「挿入先」コマンドがコメント化されている場合、エラーが発生します。
名前が解決されない:プロパティにアクセスまたは評価するときのプロパティ。私はそれを正しく使用していますか?次に、両方の「挿入先」(またはそれらの1つでも)のコメントを外すと、別のエラーが表示されます。 Forにアクセスまたは評価するときに引数が多すぎます。
何が足りないのかヒントを教えてください。宜しくお願いします。
//pattern list
fill_patterns_shuffled = {"left slant light", "horizontal light", "right slant light", "vertical light"};
//list of parameters, it can change depending on data available
list2 = {"Param1", "Param2", "Param3"};
legend_model_expr = Expr( Legend Model (53) );
For( c = 1, c <= N Items( list2 ), c++,
y_expr3 = Eval(Parse( "Properties( " || char(c-1) || ", {Fill Pattern( \!"" || fill_patterns_shuffled[ c ] || "\!") }, Item ID( \!"Mittelwert(" || char(list2[ c ]) || ")\!", 1 ) ),"
),
),
//write(y_expr3);
//Insert Into( y_expr3, 1 );
//Insert Into( legend_model_expr, Name Expr( y_expr3) );
);編集:
さて、Eval JMPを使用して、実際には存在しない「プロパティ」関数を探します。そのため、おそらくエラーが発生します。ただし、2番目のエラーは残っています。
わかりました。以下に正しいコードを貼り付けました。宜しくお願いします
//legend
legend_model_expr = Expr( Legend Model (26) );
For( c = 1, c <= N Items( list2 ), c++,
y_expr3 = substitute(expr( Properties( c1, {Fill Pattern( fill ) }, Item ID( "Mittelwert(" || name || ")" , 1 ), ), ), expr(c1), c, expr(fill), char(fill_patterns_shuffled[c]), expr(name), list2[c]);
//show(y_expr3);
Insert Into( y_expr3, "");
Insert Into( legend_model_expr, Name Expr( y_expr3) );
);