Choose Language Hide Translation Bar
Highlighted
ahutson22
Level I

Graph Builder - Copy/Paste Line Seg Color/Style/Width

I have created a script that puts three graph builder plots into a report window, each plot having it's own column switcher.  The idea is to mimic a bunch of overlay plots, but instead of needing to scroll to see all graphs, one would be able to just choose which unit op one would like to see and compare to the other two choices.  I have gotten this far, but I want changes made to the lines or x-axis to be applied to the other two graphs.

 

Using a graphics script, I am able to copy/paste some settings that are changed from one graph to another:  axis settings, line style, line color.  I need to be able to do this same thing for line width, but I have not been able to successfully copy and paste line width from one graph to another.  There doesn't seem to be a command for setting width of the line type I am using.

 

I had initially hoped to be able to copy/paste entire frame setting from one to another, but I have yet to figure that one out.  Ideally, I would be able to access the legend settings of one and copy it to the other two.

 

See below for a snippet of the code I have working and what I cannot get to work....

Any help is appreciated,

Al

 

frame1 = Report(gb1)[FrameBox( 1 )];
frame2 = Report(gb2)[FrameBox( 1 )];
frame3 = Report(gb3)[FrameBox( 1 )];

frame1 << add graphics script(
// Check for a change
If( gb1XOrigin != X Origin() | gb1XRange != X Range(),
// If a change is found, copy the new Y Origin and Y Range
// to the Flagging(Holding) variables
gb1XOrigin = X Origin();
gb1XRange = X Range();
// Copy the new axis settings from the OneWay display
// to the Bivariate Y Axis
Report( gb1 )[Axis Box( 1 )] << Copy Axis Settings;
Report( gb2 )[Axis Box( 1 )] << Paste Axis Settings;
Report( gb3 )[Axis Box( 1 )] << Paste Axis Settings;
);
For( i = 1, i <= NItems(Sel_Batches_List), i++,
seg1 = (frame1 << FindSeg( LineSeg( i ) ) );
seg2 = (frame2 << FindSeg( LineSeg( i ) ) );
seg3 = (frame3 << FindSeg( LineSeg( i ) ) );
seg1Style = seg1 << Get Line Style();
seg2 << Set Line Style( EvalExpr( seg1Style ) );
seg3 << Set Line Style( EvalExpr( seg1Style ) );
);
For( i = 1, i <= NItems(Sel_Batches_List), i++,
seg1 = (frame1 << FindSeg( LineSeg( i ) ) );
seg2 = (frame2 << FindSeg( LineSeg( i ) ) );
seg3 = (frame3 << FindSeg( LineSeg( i ) ) );
seg1Color = seg1 << Get Line Color();
seg2 << Set Line Color( EvalExpr( seg1Color ) );
seg3 << Set Line Color( EvalExpr( seg1Color ) );
);
//This is where I am running into problems, breaks the entire graphics script
/*For( i = 1, i <= NItems(Sel_Batches_List), i++,
seg1 = (frame1 << FindSeg( LineSeg( 3 ) ) );
seg2 = (frame2 << FindSeg( LineSeg( 3 ) ) );
seg3 = (frame3 << FindSeg( LineSeg( 3 ) ) );
seg1Width = seg1 << Get Line Width(); //This get works
//seg2 << Set Line Width( EvalExpr( seg1Width ) ); //Setting does not work
//seg3 << Set Line Width( EvalExpr( seg1Width ) );
);*/
);
Article Labels

    There are no labels assigned to this post.