Accessing data properties

To access properties related to a graph's data during execution, you use PowerScript graph functions. The graph functions related to data fall into several categories:

  • Functions that provide information about a graph's data

  • Functions that save data from a graph

  • Functions that change the color, fill patterns, and other visual properties of data

How to use the functions

To call functions for a graph in a graph control, use the following syntax:

graphControlName.FunctionName ( Arguments )

For example, to get a count of the categories in the window graph gr_printer, code:

Ccount = gr_printer.CategoryCount()

Different syntax for graphs in DataWindows

The syntax for the same functions is more complex when the graph is in a DataWindow, like this:

DataWindowName.FunctionName ( "graphName", otherArguments... )

For more information, see Manipulating Graphs in DataWindow Programmers Guide.

Getting information about the data

The PowerScript functions in the following table allow you to get information about data in a graph at runtime.

Function

Information provided

CategoryCount

The number of categories in a graph

CategoryName

The name of a category, given its number

DataCount

The number of data points in a series

FindCategory

The number of a category, given its name

FindSeries

The number of a series, given its name

GetData

The value of a data point, given its series and position (superseded by GetDataValue, which is more flexible)

GetDataLabelling

Indicates whether the data at a given data point is labeled in a DirectX 3D graph

GetDataieExplode

The percentage by which a pie slice is exploded

GetDataStyle

The color, fill pattern, or other visual property of a specified data point

GetDataTransparency

Indicates the transparency value of a given data point in a DirectX 3D graph

GetDataValue

The value of a data point, given its series and position

GetSeriesLabelling

Indicates whether a data series has a label in a DirectX 3D graph

GetSeriesStyle

The color, fill pattern, or other visual property of a specified series

GetSeriesTransparency

Indicates the transparency value of a data series in a DirectX 3D graph

ObjectAtPointer

The graph element over which the mouse was positioned when it was clicked

SeriesCount

The number of series in a graph

SeriesName

The name of a series, given its number


Saving graph data

The PowerScript functions in the following table allow you to save data from the graph.

Function

Action

Clipboard

Copies a bitmap image of the specified graph to the clipboard

SaveAs

Saves the data in the underlying graph to the clipboard or to a file in one of a number of formats


Modifying colors, fill patterns, and other data

The PowerScript functions in the following table allow you to modify the appearance of data in a graph.

Function

Action

ResetDataColors

Resets the color for a specific data point

SetDataLabelling

Sets the label for a data point in a DirectX 3D graph

SetDataPieExplode

Explodes a slice in a pie graph

SetDataStyle

Sets the color, fill pattern, or other visual property for a specific data point

SetDataTransparency

Sets the transparency value for a data point in a DirectX 3D graph

SetSeriesLabelling

Sets the label for a series in a DirectX 3D graph

SetSeriesStyle

Sets the color, fill pattern, or other visual property for a series

SetSeriesTransparency

Sets the transparency value for a series in a DirectX 3D graph