Charts > Example: Variable number of items from a StreamIN Event

Example: Variable number of items from a StreamIN Event
In this example, you create a chart for different types of articles showing the name of the article (Label), and the number of articles sold (Value) during a month.
The article items are defined in a block in the StreamIN tool, which means you cannot tell how many items to include in the chart. By enabling the array function for the block, the arrays are automatically created for the data.
Assigning variables in the Event
This example uses a StreamIN Event containing the block Articles.
Select Array type = Yes when defining the properties for the Articles block.
The Articles block has one field for the article name, and one field for the number of articles sold. Assign a variable to the name field ($label_article), and another variable to the amount field ($value_article).
Making sure that the arrays contain all required values
Before the chart is generated, you must make sure that the arrays contain all required values. How you do this will depend on what data you want to include in the chart. In this example, you first insert the chart in a free block inserted directly on the PageOUT sheet. You then call the free block after the frame that includes the Articles block.
Adding variables to the Process
Add a new item in the Chart Properties dialog box. Select the Array option, and enter the Value ($value_article) and Label ($label_article) variables.
OpenText StreamServe 5.6 Updated: 2013-03-01