Thanks Experts!
I set more conditions in the actual application.
Like this form.I still don't know how to add multiple columns after the fact
ca = "row";dt = New Table( "test", Add Rows( 40 ), New Column( ca, Character, "Nominal" ) );
Column( ca ) << Formula( Char( Row() ) );dt << run formulas;Column( ca ) << deleteFormula;
na = {"A", "B", "C", "D", "E"};
j = 1;
For( j = 1, j <= N Items( na ), j++,
i = 1;
For( i = 1, i <= 4, i++,
ca = na[j] || Char( i ); New Column( ca );
Column( ca ) << Formula( If( i == 1, Random Integer( -100, 100 ), Random Integer( 30 * i, 50 * i ) ) );
dt << run formulas; Column( ca ) << deleteFormula; Column( ca ) << Set Display Width( 38 );
);
);
p1=dt<<Graph Builder(Size(534,425),Show Control Panel(0),Show Legend(0),Show Title(0),Show Footer(0),Show X Axis(0),Show Y Axis(0),Show X Axis Title(0),Variables(X(:row)
,Y(:A1),Y(:A2,Position(1),Side("Right")),Y(:A3,Position(1),Side("Right")),Y(:A4,Position(1),Side("Right"))
,Y(:B1),Y(:B2,Position(2),Side("Right")),Y(:B3,Position(2),Side("Right")),Y(:B4,Position(2),Side("Right")))
,Elements(Position(1,1),Bar(X,Y(1),Legend(10)),Line(X,Y(2),Y(3),Y(4),Legend(8)))
,Elements(Position(1,2),Bar(X,Y(1),Legend(11)),Line(X,Y(2),Y(3),Y(4),Legend(9)))
,SendToReport(
Dispatch({},"A1",ScaleBox,{Min( -100),Max(110),Inc(50),Minor Ticks(1)}),Dispatch({},"B1",ScaleBox,{Min( -100),Max(110),Inc(50),Minor Ticks(1)}),
Dispatch({},"A2",ScaleBox,{Min(0),Max(210),Inc(50),Minor Ticks(1)}),Dispatch({},"B2",ScaleBox,{Min(0),Max(210),Inc(50),Minor Ticks(1)}),
Dispatch({},"400",ScaleBox,{
Legend Model(10,Properties(0,{Transparency(0.5)},Item ID("A1",1))),Legend Model(8,Properties(0,{Line Color(53),Transparency(0.8)},Item ID("A2",1)),Properties(1,{Line Color(51),Transparency(0.5)},Item ID("A3",1)),Properties(2,{Line Color(52),Transparency(0.8)},Item ID("A4",1))),
Legend Model(11,Properties(0,{Transparency(0.5)},Item ID("B1",1))),Legend Model(9,Properties(0,{Line Color(53),Transparency(0.5)},Item ID("B2",1)),Properties(1,{Line Color(51),Transparency(0.8)},Item ID("B3",1)),Properties(2,{Line Color(52),Transparency(0.5)},Item ID("B4",1)))
}),Dispatch({},"Y r title",TextEditBox,{Hide(1)}),Dispatch({},"Y 1 r title",TextEditBox,{Hide(1)}),Dispatch({},"400",LegendBox,{Legend Position({
10,[6],8,[0,1,2],
11,[7],9,[3,4,5]
})})));;
Illustration:
A1-A4 is a group of the same letters, are listed as a group of 4, move A2-A4 to the right of the Y axis to form a line graph;A1 is the bar chart,
The color of the bar is variable, but the color of the line on the right is fixed by number (the same color as the line with different letter groups of the number).
The graphics are set to transparency.The right Y-axis title is also hidden.
So there's a lot more code for mapping.I don't know how to batch them.
Thanks!