Macro recording of Statistica graphs

Macro recording of Statistica graphs

book

Article ID: KB0081823

calendar_today

Updated On:

Products Versions
Spotfire Statistica 10 and later versions

Description

Can Statistica Visual Basic macros be recorded for Statistica graphs? 

 

Issue/Introduction

Can Statistica Visual Basic macros be recorded for Statistica graphs? 

Resolution

Yes, macro recording enables access, programmatically, to almost every aspect and virtually every detail of the functionality of Statistica. Even the most complex graphs can be recorded into Statistica Visual Basic (SVB) macro programs.

For example, when using a Box-Whiskers to demonstrate:

1.Create a Box-Whiskers plot of the "MEASURE01" variable from the Statistica Example Data Adstudy.sta.

    User-added image

2.Open the Graph Options dialog by double clicking the graph background or by right clicking in the graph background and choosing "Graph options"

3. Select the Record Macro check box at the bottom of the Graph Options dialog.

4.Modify the Color Background in the Graph|Window (You can also change other graph options of interest).

    User-added image

4. Click the "OK" to generate a macro containing the specific changes.

5. Enter the name for the new macro and click "OK".

      User-added image

6. Close all analyses, workbooks and datasets open in Statistica (except the macro). You may optionally choose to save the macro. 

7.  Open a different dataset (Say Characteristics.sta from Statistica example datasets) and create a histogram (with variable Eye Color) 

8. After the graph is created, bring the macro to the front (Open the macro if it was saved and closed in  step 6 )

9. In the Macro menu, click "Run Macro" button .

   User-added image

10. After running the macro, the graph style will be changed based on the recorded macro.

   User-added image

DISCLAIMER : If options specific to a specific graph was changed  such as the bar color in a histogram, then it is recommended that the macro is run on the same type of graph that it was recorded for.