Salut,
Je suis bloqué sur un problème et je serais reconnaissant pour quelques conseils :
Nous analysons des échantillons et obtenons la population A, B, C, D et E pour chaque échantillon.
Les informations pour A peuvent être divisées en « % » et « nombre », de même pour B, C, D et E.
Nous importons les données et les colonnes nommées « A 1 » à « E 1 » représentent les valeurs « % », celles appelées « A 2 » à « E 2 » représentent les valeurs « Count ».
Comme l'importation sera toujours la même, l'écriture d'un script pour générer des graphiques avec 2 axes Y ("%" et "count") pour chaque type de population (A, B, C etc.) était gérable. Voir le code ci-dessous.
Le problème : nous obtenons parfois une lecture supplémentaire pour certaines de nos populations. Par exemple, seules les populations B et E auront une troisième information appelée « fluorescence ». Celles-ci seront importées sous les colonnes « B 3 » et « E 3 » dans la même table.
Étant donné que ces populations peuvent varier d'une importation à l'autre, je dois écrire un script capable d'identifier « B 3 » comme membre des « B » et de créer un troisième axe Y dans le graphique de la population « B » (et la même chose pour « E 3 » dans cet exemple). Mais pour cela, je ne suis pas assez intelligent/expérimenté.
Bien sûr, j'ai essayé de réorganiser le tableau, de créer de nouvelles lignes au lieu de nouvelles colonnes et de travailler avec "wrap". Mais là, nous n'avons pas de mise à l'échelle automatique pour chaque axe Y. J'ai également essayé un tableau associé pour les trois types d'informations, mais j'ai échoué en raison du manque d'expérience en codage.
Peut-être que l'un d'entre vous a une idée, cela pourrait être utile, merci
Names Default To Here( 1 );
dt = Current Data Table();
dt << clear select;
win = New Window( "Test", Outline Box( "", hb = V List Box() ) );
loopstart = Contains(dt << get column names, Column("A 1"));
loopend = (Contains(dt << get column names, Column("A 2")))-1;
icounts = (loopend+1)-loopstart;
For( i = loopstart, i <= loopend, i++,
gb = Graph Builder(
Size( 1500, 900 ),
Show Control Panel( 0 ),
Grid Color( "Black" ),
Graph Spacing( 2 ),
Legend Position( "Bottom" ),
Variables( X( :Group ), Y( Eval( i ) ), Y( Eval( i + icounts ) ), Color( :Subjects ) ),
Elements( Position( 1, 1 ), Points( X, Y, Legend( 11 ) ), Box Plot( X, Y, Legend( 13 ) ) ),
Elements( Position( 1, 2 ), Points( X, Y, Legend( 12 ) ), Box Plot( X, Y, Legend( 14 ) ) ),
SendToReport(
Dispatch( {}, "Graph Builder", OutlineBox, {Set Title( "DATA" ), Image Export Display( Normal )} ),
Dispatch( {}, "graph title", TextEditBox, {Set Text( "Title" )}, {Set Font Size( 16 )} ),
Dispatch( {}, "Y title", TextEditBox, {Set Font Size( 14 ), Set Font Style( "bold" ), Set Text( " [%]" )} ),
Dispatch( {}, "Y1 title", TextEditBox, {Set Font Size( 14 ), Set Font Style( "bold" ), Set Text( " Count" )} ),
Dispatch( {}, "X title", TextEditBox, {Set Font Size( 14 ), Set Font Style( "bold" )} ),
Dispatch(
{},
"400",
LegendBox,
{Set wrap( 12 ), Set Title( "" ), font( "Segoe UI", 12, "Plain" ), Legend Position(
{11, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, -1], 13, [-1], 12, [-1], 14, [-1]
}
), Orientation( "Vertical" )}
)
)
);
hb << Append( Report( gb ) << child );
hb << append( Page Break Box() );
gb << close window;
);Voici un code assez laid, mais il semble vous fournir ce dont vous avez besoin

Names Default To Here( 1 );
dt = Current Data Table();
dt << clear select;
win = New Window( "Test", Outline Box( "", hb = V List Box() ) );
loopstart = Contains( dt << get column names, Column( "A 1" ) );
loopend = (Contains( dt << get column names, Column( "A 2" ) )) - 1;
fluorB3 = Contains( dt << get column names, Column( "B 3" ) );
fluorE3 = Contains( dt << get column names, Column( "E 3" ) );
icounts = (loopend + 1) - loopstart;
For( i = loopstart, i <= loopend, i++,
If( (Column( i ) << get name == "B 1" & fluorB3 > 0) | (Column( i ) << get name == "E 1" & fluorE3 > 0),
If( Column( i ) << get name == "B 1",
fluorcounts = fluorB3,
fluorcounts = fluorE3
);
gb = Graph Builder(
Size( 1517, 788 ),
Show Control Panel( 0 ),
Legend Position( "Bottom" ),
Grid Color( "Black" ),
Graph Spacing( 2 ),
Variables( X( :Group ), Y( Eval( i ) ), Y( Eval( i + icounts ) ), Y( Eval( fluorcounts ) ), Color( :Subjects ) ),
Elements( Position( 1, 1 ), Points( X, Y, Legend( 11 ) ), Box Plot( X, Y, Legend( 13 ) ) ),
Elements( Position( 1, 2 ), Points( X, Y, Legend( 12 ) ), Box Plot( X, Y, Legend( 14 ) ) ),
Elements( Position( 1, 3 ), Points( X, Y, Legend( 15 ) ), Box Plot( X, Y, Legend( 16 ) ) ),
SendToReport(
Dispatch( {}, "Graph Builder", OutlineBox, {Set Title( "DATA" ), Image Export Display( Normal )} ),
Dispatch( {}, "400", ScaleBox, {Legend Model( 12, Base( 0, 0, 0, Item ID( "Car", 1 ) ) )} ),
Dispatch( {}, "graph title", TextEditBox, {Set Text( "Title" )} ),
Dispatch( {}, "X title", TextEditBox, {Set Font Size( 14 ), Set Font Style( "Bold" )} ),
Dispatch( {}, "Y title", TextEditBox, {Set Text( " [%]" ), Set Font Size( 14 ), Set Font Style( "Bold" )} ),
Dispatch( {}, "Y 1 title", TextEditBox, {Set Text( " Count" ), Set Font Size( 14 ), Set Font Style( "Bold" )} ),
Dispatch( {}, "Y 2 title", TextEditBox, {Set Text( " Fluor" ), Set Font Size( 14 ), Set Font Style( "Bold" )} ),
Dispatch(
{},
"400",
LegendBox,
{font( "Segoe UI", 12, "Plain" ), Orientation( "Vertical" ), Set Wrap( 12 ),
Legend Position(
{11, [0, 1, 2, 3], 13, [-1, -1, -1, -1, -1, -3], 12, [-1, -3, -3, -3], 14, [-1, -1, -1, -1, -1, -3], 15, [-1, -1,
-1, -1, -1, -3], 16, [-1, -1, -1, -1, -1, -3]}
)}
)
)
);
,
gb = Graph Builder(
Size( 1500, 900 ),
Show Control Panel( 0 ),
Grid Color( "Black" ),
Graph Spacing( 2 ),
Legend Position( "Bottom" ),
Variables( X( :Group ), Y( Eval( i ) ), Y( Eval( i + icounts ) ), Color( :Subjects ) ),
Elements( Position( 1, 1 ), Points( X, Y, Legend( 11 ) ), Box Plot( X, Y, Legend( 13 ) ) ),
Elements( Position( 1, 2 ), Points( X, Y, Legend( 12 ) ), Box Plot( X, Y, Legend( 14 ) ) ),
SendToReport(
Dispatch( {}, "Graph Builder", OutlineBox, {Set Title( "DATA" ), Image Export Display( Normal )} ),
Dispatch( {}, "graph title", TextEditBox, {Set Text( "Title" )}, {Set Font Size( 16 )} ),
Dispatch( {}, "Y title", TextEditBox, {Set Font Size( 14 ), Set Font Style( "bold" ), Set Text( " [%]" )} ),
Dispatch( {}, "Y1 title", TextEditBox, {Set Font Size( 14 ), Set Font Style( "bold" ), Set Text( " Count" )} ),
Dispatch( {}, "X title", TextEditBox, {Set Font Size( 14 ), Set Font Style( "bold" )} ),
Dispatch(
{},
"400",
LegendBox,
{Set wrap( 12 ), Set Title( "" ), font( "Segoe UI", 12, "Plain" ), Legend Position(
{11, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, -1], 13, [-1], 12, [-1], 14, [-1]}
), Orientation( "Vertical" )}
)
)
)
);
hb << Append( Report( gb ) << child );
hb << append( Page Break Box() );
gb << close window;
);