cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Submit your abstract to the call for content for Discovery Summit Americas by April 23. Selected abstracts will be presented at Discovery Summit, Oct. 21- 24.
Discovery is online this week, April 16 and 18. Join us for these exciting interactive sessions.
Choose Language Hide Translation Bar

Add Row legend to Control Chart

Hey all!

I'm working on some P-charts and I would like to add a legend. First thing I notice is that I can't "click my way" to adding one to a chart. I've tried forcing my script to add it, and that results in an error (as expected).

Any ideas how I can add a legend? I suspect it will involve more advanced scripting techniques, but I'm open :).

Cheers!
Chadd

Example Script:
asdf = Current Data Table() << Control Chart(
Sample Label( :week ),
Sample Size( :units ),
KSigma( 3 ),
Chart Col( :Blah, P ),
By( :stuff )
);

Report(asdf)[Frame Box(1)] << Row Legend (:week, color(1), marker(1));

Error:
Send Expects Scriptable Object in access or evaluation of 'Send' , Report( asdf )[Frame Box( 1 )] << Row Legend( :week, color( 1 ), Marker( 1 ) )
1 REPLY 1

Re: Add Row legend to Control Chart

I believe the error is because of the color and marker fields. If you run the command just with 

Report(asdf)[Frame Box(1)] << Row Legend (:week);

this should work fine. 

The legend will use the color settings in the column :week whic you would have to define in advance, best in the column properties as value labels or alternatively as Mark rows by column option using this column..

/****NeverStopLearning****/