How can I modify the appearance of graphs (e.g., axis labels) from within SVB?
The customization of graphs proceeds in much the same way as the customization of spreadsheets. After a graph object is created (see also What is meant by the term "object model?"), various properties and methods are available to customize practically all aspects of the display. An example of how to create a blank graph, set data into the graph, and add an arrow is described in How can I create a blank graph, and set data directly into the graph?; here is an example of how to customize the font of the x-axis labels in a histogram:
Sub Main
' Create an analysis object; create a histogram from ' a variable in datafile Exp.sta (this example ' datafile may be located in a different directory ' on you installation). Dim a As Analysis Set a = Analysis (sc2dHistograms, _ Path & "\Examples\DataSets\Exp.sta") a.Dialog.Variables = "5" ' Retrieve the first graph object from the collection. ' Note that all results spreadsheets and graphs ' are created in Statistica as collections of ' objects. Dim g as Graph Set g = a.Dialog.Graphs(1) ' Make the graph visible. g.Visible=True ' The Content property returns a "polymorphic" ' object, i.e., an object depending on the graph ' type that was created. Dim l As Object Set l = g.Content ' Next we want to "get to" the axes of the plot. ' Xaxis is a property of graph Content.Axes: Dim x As Axis2D Set x = l.Axes.Xaxis ' To modify the font of the x-axis labels, retrieve ' the Font property (object) of the x-axis. Dim xf As GraphicsFont2 Set xf=x.Font ' Change the size of the font. xf.Size=20 ' To change the Font itself, retrieve the FontFace ' property (object) from the GraphicsFont2 object. Dim xff As FontFace Set xff=xf.Face ' Finally, set the font to bold. xff.Bold=True
End Sub
As you can see, to set the font of the x-axis labels to bold, you retrieve the Graph object, then the ("polymorphic," i.e. depending on the graph) Graph Content object, then the Axis2D object, then the GraphicsFont2 object, then the FontFace object, and finally set the Bold property. This example illustrates how learning Statistica Visual Basic means learning to navigate the Statistica object model. Fortunately, the object model is organized into a logical hierarchy, and it can be reviewed via the Object Browser; for additional details, see What is meant by the term "object model?".