Fuego.Chart : DataSourceFactory

The DataSourceFactory component is used to create XYDataSource and XYZDataSource objects, the data sources for building XY and XYZ charts in a BPM Object. Usually the Object represents a Dashboard.

Data sources that have been created using the methods of the DataSourceFactory component cannot be extended.

Example

This example shows how to create a bar chart using the createDataSource() method using values of type Real. In this case the data is retrieved from a database and stored in an intermediate array.

 values as Real[][]
 yheaders as String[]
 i as Int
 i = 0

 for each element in
   SELECT custtype, max(credlimit), min(credlimit)
   FROM CUSTOMER
   GROUP BY custtype
 do
     values[i] = [element.columnexpr1,element.columnexpr2]
     extend yheaders using element.custtype
     i = i + 1
 end

 xyzDataSource = DataSourceFactory.createDataSource(
                            Values : values,
                            xHeaders : ["Max Cred", "Min Cred"],
			    yHeaders : yheaders)
 return xyzDataSource
Related reference
Fuego.Chart : XYDataSource
Fuego.Chart : DefaultXYDataSource
Fuego.Chart : XYZDataSource
Fuego.Chart : DefaultXYZDataSource