This article contains a sample script for using the DateValue BASIC automation command to specify date/time axes limits.
To run this script:
- Click here to download the BAS file: DateTimeAxesLimits.BAS
- Click Automation | Scripts | Run, select the BAS file from your downloads directory, and click Open.
OR:
- Copy the script below.
- Open Grapher and turn on the Script Manager by clicking View | Display | Script Manager.
- Press Ctrl+A to select all of the existing lines in the Script Manager and then press DELETE.
- Press Ctrl+V to paste it into the Script Manager.
- Click the Start/Resume icon ( ) in the Script Manager.
Sub Main 'Initialize Grapher Dim Grapher As Object Set Grapher = CreateObject("Grapher.Application") Grapher.Visible = True Set Plot1 = Grapher.Documents.Add(grfPlotDoc) Plot1.Windows.Item(1).PageUnits(grfInches) 'Create line plot graph Plot1.Shapes.AddLinePlotGraph("C:\Program Files\Golden Software\Grapher 15 Preview\Samples\3D bar chart.dat",1,2) 'Define object pointers Set Graph1 = Plot1.Shapes.Item(1) Set YAxis1 = Graph1.Axes.Item(2) Set XAxis1 = Graph1.Axes.Item(1) Set LineScatterPlot1 = Graph1.Plots.Item(1) 'Set TickLabels.UseDateTimeFormat XAxis1.TickLabels.UseDateTimeFormat = True 'Set Min XAxis1.AutoMin = False XAxis1.Min = DateValue("7/2/1905") 'Set Clipping.XMinMode LineScatterPlot1.Clipping.XMinMode = grfClipAxis End Sub
Updated August 13, 2019
Comments
Please sign in to leave a comment.