SetDataFilter Method

The SetDataFilter method creates an array of data filter strings from all rows in the Data Filter dialog.

Syntax

object.SetDataFilter( array )

 

Parameter Type Description
Array Array required, an array that contains the data filter text

 

Remarks

The Data Filter dialog has options to Filter data in and Filter data out. The SetDataFilter method has the same functionality. To filter data out, add "NOT" to the beginning of the filter expression, as shown in the example below. To filter data in, omit "NOT".

Example 1

This example shows how to set a data filter.

LineScatterPlot.Clipping.SetDataFilter(Array1)

Example 2

This example shows how to build and then set a data filter.

Sub Main

'Create Grapher as an Object

Dim Grapher As Object

 

'Start Grapher

Set Grapher = CreateObject("Grapher.Application")

Grapher.Visible = True

 

'Open an existing document

Set Criteria15gpj = Grapher.Documents.Open("D:\Temp\CriteriaTest15.gpj")

 

'Define object pointer

Set Graph1 = Criteria15gpj.Shapes.Item(1)

 

'Define object pointer

Set LineScatterPlot = Graph1.Plots.Item(1)

 

'Select object

LineScatterPlot.Select

 

Dim Array1(1) As String

 

Array1(0) = "NOT ([Column A] = 3 OR [Column A] >= 1 AND [Column A] <= 2 OR [Column

B] = 3 OR [Column B] >= 1 AND [Column B] <= 2)"

 

Array1(1) = "[Column E] = ""CA"" OR [Column E] = ""TX"""

 

'Call Clipping.SetDataFilters

LineScatterPlot.Clipping.SetDataFilter(Array1)

End Sub

 

See Also

Data Filter