Ich versuche, die Ausrichtung der Beschriftungen und das Format (Engineering SI) für die horizontale Achse in den Verteilungsdiagrammen (Histogrammen) zu ändern. Ich kann dies für das erste tun, indem ich eine Dispatch-Anweisung innerhalb des Ausdrucks verwende, den ich erstelle, aber ich muss in der Lage sein, dies für alle Histogramme in der Spaltenliste zu tun.
Ich habe versucht, verschiedene Arten von Aufrufen in den Spaltennamen zwischen den "{}" einzufügen in:
Versenden( {},
aber keines bewirkt, dass sich die Histogramme ändern. Es funktioniert, wenn ich nur den Spaltennamen (dh {"Meine Spalte"}) schreibe, aber ich möchte, dass es für alle Namen im colList-Array ausgeführt wird.
dt = currentdatatable();
col = dt << get column names();
nc = N Items( col );
colList = {};
bin_width={};
For( i = 1, i <= nc, i++,
If(Contains (col[i],"::"),
Insert Into( colList, col[i] ))
);
For(i = 1, i <= N Items(colList), i++,
Insert Into(bin_width,0.0);
bin_width[i] = Col Max(Column(dt, colList[i])) - Col Min(Column(dt, colList[i]));
bin_width[i] = bin_width[i]/10;
);
theExpr = "dis = dt << Distribution(Stack( 1 ),
Continuous Distribution( column( column(dt,colList[1])), Set Bin Width(bin_width[1]), Label Row( Label Orientation( \!"Perpendicular\!" ) ))
";
For( i = 2, i < N Items( colList ), i++,
theExpr = theExpr || ", Continuous Distribution( column( column(dt, colList[" || Char( i ) || "])), Set Bin Width(bin_width[i]))"
);
theExpr = theExpr || ",
SendToReport(
Dispatch(
{},
\!"1\!",
ScaleBox,
{Format( \!"Engineering SI\!", 10 ), Minor Ticks( 0 ),
Label Row( Label Orientation( \!"Perpendicular\!" ) )}
)
);";
Eval( Parse( theExpr ) );So würde ich vorgehen
dt = currentdatatable();
col = dt << get column names();
nc = N Items( col );
colList = {};
bin_width={};
For( i = 1, i <= nc, i++,
If(Contains (col[i],"::"),
Insert Into( colList, col[i] ))
);
For(i = 1, i <= N Items(colList), i++,
Insert Into(bin_width,0.0);
bin_width[i] = Col Max(Column(dt, colList[i])) - Col Min(Column(dt, colList[i]));
bin_width[i] = bin_width[i]/10;
);
theExpr = "dis = dt << Distribution(Stack( 1 ),
Continuous Distribution( column( column(dt,colList[1])), Set Bin Width(bin_width[1]), Label Row( Label Orientation( \!"Perpendicular\!" ) ))
";
For( i = 1, i < N Items( colList ), i++,
theExpr = theExpr || ", Continuous Distribution( column( column(dt, colList[" || Char( i ) || "])), Set Bin Width(bin_width[i]))"
);
Eval( Parse( theExpr ) );
(dis << xpath("//AxisBox")) << format("Engineering SI", 10);
(dis << xpath("//AxisBox")) << Minor Ticks( 0 );
(dis << xpath("//AxisBox")) << Label Row( Label Orientation( "Perpendicular" ));
Danke Jim das hat perfekt geklappt