Hi all, hope you can help me with below concern. I am trying to create a graph box chart, but I want the data to be displayed taken from an interactive window, so far I only can do it by creating a table, then taking the values from the table to be presented in the graph.
See the script I created:
// Script starts here:
// I created this table "Measurements" in order to create the data with data to be displayed in the chart.
Meas = New Table( "Measurements",invisible, Add Rows( 1 ),
New Column( "AVG", Numeric, "Continuous", Format( "Best", 12 ), Set Values( [3] ) ),
New Column( "STDEV", Numeric, "Continuous", Format( "Best", 12 ), Set Values( [1] ) ));
// This interactive window is in order to input the values to be displayed in the chart instead of taking them from the table "measurements".
New Window( "SCRIPT REQUIREMENTS",
<<Modal,
H List Box(
V List Box(
Text Box ("Provide Data"),
Text Box( "" ),
Lineup Box( 2, Text Box( "Mean " ), input_box0 = Text Edit Box( "1.8", set width(80) ) ),
Lineup Box( 2, Text Box( "Sigma" ), input_box1 = Text Edit Box( "2.5", set width(80) ) ),
),
V List Box( Text Box( "" ), Button Box( "OK"),
Button Box( "Cancel" , nw << Close Window) )
)
);
MeanInput = input_box0 << get text ;
SigmaInput = input_box1 << get text ;
MeanPicked = char(MeanInput);
show (MeanPicked);
SigmaPicked = char(SigmaInput);
show (SigmaPicked);
nw = New Window( "Chart",
Graph Box(
X Scale( -1, 5 ),
Y Scale( 0, 3 ),
FrameSize(250,180),
Title( "Chart" ),
Pen Color( "gray" );
Pen Size( 1 );
Line Style( "Dotted" );
H Line( 0.5 ); H Line( 1 ); H Line( 1.5 ); H Line( 2 ); H Line( 2.5 ); H Line( 3 );
V Line( 0 ); V Line( 1 ); V Line( 2 ); V Line( 3 ); V Line( 4 );
Fill color ("blue");
Circle( {Meas:AVG[1 :: N Rows( Meas )], Meas:STDEV[1 :: N Rows( Meas )]},0.09, "fill" ); // This works using the table, but I do not want to use the table.
//Circle( {""||MeanPicked||"", ""||SigmaPicked||""},0.09, "fill" ); // This is what I've tried so far, it should take the data from the iteractive window, it is no yet working.
));
axisbox = nw[axis box( 1 )];
axisbox << RemoveAxisLabel( "X" );
axisbox << AddAxisLabel( "Std Dev" );
axisbox = nw[axis box( 2 )];
axisbox << RemoveAxisLabel( "Y" );
axisbox << AddAxisLabel( "Mean" );