Hi King, 1. Can be done by SaxBasic script (see below) 2. Cannot be done by SaxBasic script. I expect that it is possible to do this with the Graphic Programming Language (GPL) introduced in v14 but I did not investigate since you have v13. 3. Can be done by SaxBasic script (see below) King, If I misinterpreted questions 1 or 3, let me know and I will try to modify the code accordingly. ' Purpose of script: hides x and y axis titles, hide error-bar legend ' Posted to SPSSX-L list by Raynald Levesque on 2005/12/03 '
www.spsstools.net 'DATA LIST LIST / AIRLINEA ALOALL. 'Begin DATA '1 75 '1 51 '1 51 '2 51 '2 75 '2 75 '3 75 '3 100 '3 100 'End DATA. 'VAR LEVEL airlinea (NOMINAL) . 'IGRAPH ' /VIEWNAME='Bar Chart' ' /X1 = VAR(AIRLINEA) Type = CATEGORICAL ' /Y = VAR(ALOALL) Type = SCALE (MIN=50 MAX = 100) ' /COORDINATE = VERTICAL ' /TITLE='Airline Overall' ' /X1LENGTH=6.0 ' /YLENGTH=3.0 ' /X2LENGTH=3.0 ' /CATORDER VAR(AIRLINEA)(DESCENDING MEAN VAR(ALOALL) OMITEMPTY) ' /BAR(MEAN) KEY=OFF LABEL OUTSIDE Val SHAPE = RECTANGLE BASELINE = AUTO ' /ERRORBAR CI(95.0) DIRECTION = BOTH CAPWIDTH (45) CAPSTYLE = T. Option Explicit Const ERROR_BAR=15 Sub Main Call Test End Sub Sub Test() ' Declare variables. Dim objOutputDoc As ISpssOutputDoc Dim objOutputItems As ISpssItems Dim objOutputItem As ISpssItem Dim objSPSSIGraph As ISpssIGraph Dim intItemCount As Integer 'number of output items Dim intItemType As Integer 'type of item (see SpssType property) Dim strLabel As String 'Item label Dim lngNb As Long Dim index As Long Dim idx2 As Long Dim MyIGraphElement As ISpssIGraphElement Dim MyArea As ISpssIGraphArea Dim MyAxis As ISpssIGraphAxis ' Open saved output document specified by the OutputFile parameter ' and make it visible. Set objOutputDoc = objSpssApp.GetDesignatedOutputDoc objOutputDoc.Visible = True Debug.Clear ' Get Output Items collection. Set objOutputItems = objOutputDoc.Items() ' Iterate through output items. intItemCount = objOutputItems.Count() For index = 0 To intItemCount - 1 Set objOutputItem = objOutputItems.GetItem(index) intItemType = objOutputItem.SPSSType() strLabel = objOutputItem.Label ' If item is a chart, modify its title, subtitle, and caption, then ' activate and export it. If intItemType = SPSSIGraph And objOutputItem.Visible =True Then Set objSPSSIGraph = objOutputItem.GetIGraphOleObject lngNb = objSPSSIGraph.Elements.Count For idx2 =0 To lngNb -1 Set MyIGraphElement = objSPSSIGraph.Elements(idx2) Debug.Print MyIGraphElement.Type If MyIGraphElement.Type = ERROR_BAR Then MyIGraphElement.Key = False 'Hide the Legend of the error bar End If 'This paragraph would change color of ALL bars 'If MyIGraphElement.Type = 1 Then 'SpssIGraphBar ' Set MyArea = MyIGraphElement.GetArea ' MyArea.BackgroundColor = vbBlue 'End If Next Set MyAxis = objSPSSIGraph.GetAxis(1) 'x-axis 'MyAxis.LabelFrequency = 1 'Uncomment this line to hide the labels 1, 2 and 3 MyAxis.GetTitle.Show = False 'Hides "AIRLINEA" Set MyAxis = objSPSSIGraph.GetAxis(0) 'y-axis MyAxis.GetTitle.Show = False 'Hides "ALOALL" End If Next index objSPSSIGraph.Redraw objOutputItem.Selected = True objOutputItem.Selected = False Set objOutputDoc = Nothing Set objOutputItem = Nothing End Sub Regards Raynald Levesque
Raynald@spsstools.net Visit my SPSS site:
http://www.spsstools.net