Populating a graph with data – PB Docs 125

Populating a graph with data

This section shows how you can populate an empty graph with
data.

Using AddSeries

You use AddSeries to create a series. AddSeries has
this syntax:

AddSeries returns an integer that identifies
the series that was created. The first series is numbered 1, the
second is 2, and so on. Typically you use this number as the first
argument in other graph functions that manipulate the series.

So to create a series named Stellar,
code:

Using AddData

You use AddData to add data points to a
specified series. AddData has this syntax:

The first argument to AddData is the number
assigned by PowerBuilder to the series. So to add two data points
to the Stellar series, whose number is stored by
the variable SNum (as shown above), code:

note.png Getting a series number

You can use the FindSeries function to
determine the number PowerBuilder has assigned to a series. FindSeries returns
the series number. This is useful when you write general-purpose
functions to manipulate graphs.

An example

Say you want to graph quarterly printer sales. Here is a script
that populates the graph with data:

Here is the resulting graph:

dagr02.gif

You can add, modify, and delete data in a graph in a window
through graph functions anytime during execution.

For more information

For complete information about each graph function, see the PowerScript Reference.


Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x