J'essaie de changer l'orientation des étiquettes et le format (Ingénierie SI) pour l'axe horizontal dans les tracés de distribution (histogrammes). Je peux le faire pour le premier en utilisant une instruction de répartition dans l'expression que je construis, mais je dois pouvoir le faire pour tous les histogrammes de la liste des colonnes.
J'ai essayé d'insérer différents types d'appels au nom de la colonne entre le "{}" dans :
Envoi( {},
mais aucun ne fait changer les histogrammes. Cela fonctionne si je mets littéralement le nom de la colonne (c'est-à-dire {"Ma colonne"}) uniquement, mais je veux qu'il le fasse pour tous les noms du tableau colList.
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 ) );Voici l'approche que je prendrais
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" ));
Merci Jim cela a parfaitement fonctionné