Hi,
I'm writing a script that will work with files that have a variety of columns, so I had to modify an example I found on here which concatenates the Graph Builder call based on the number of columns. Despite being clumsy, it does seem to work, but my issue is that I then want to change the X-axis to log scale, change the limits, etc. I tried a few approaches from the Scripting Index and examples, but none seemed to work.
Would very much appreciate a pointer in the right direction on the axis settings, but if anybody has an idea of how to do initial graphing portion better, that would be great too, thanks!
dt = Current Data Table();
ColNameList = dt << Get Column Names (continuous, string);
//Start with initial graph builder
GraphExpr = "
TestGraph = Graph Builder(
Size( 534, 456 ),
Show Control Panel( 0 ),
Variables(";
//Add X Entry
GraphExpr = GraphExpr || "
X( :Name( \!"" || ColNameList[1] || "\!") ),";
//Add the first Y entry
GraphExpr = GraphExpr || "
Y( :Name( \!"" || ColNameList[2] || "\!") ),";
//Add the second Y entry
For( i = 3, i <= N items (ColNameList), i++,
GraphExpr = GraphExpr || "
Y( :Name( \!"" || ColNameList[i] || "\!"), Position (1) ),";
);
//Close out Variables section
GraphExpr = GraphExpr || "
),
Elements(
Line( X, Y( 1 )";
//Build out the lines for all columns
For( i = 2, i <= N items (ColNameList), i++,
GraphExpr = GraphExpr || ", Y( " || char(i) || " )"
);
GraphExpr = GraphExpr || ", Legend( 1 )
)
)
)";
eval(parse(GraphExpr));
TestGraph << Show Legend (0);