BPC-Components

Home > Products > BPC PowerForms > Knowledge Base > API Reference > The Chart control

The Chart control

Chart is a new control which can be used to display information in two different ways:

 

As a Pie Chart

 

As a Bar Chart

 

Designer Properties

Type : Chart

Name

Provides a unique name for the control.

Enabled for new records

Sets if the control will be enabled or disabled when the forms handles a new record

Enabled for existing records

Sets if the control will be enabled or disabled when the forms handles an existing record

Required

Marks the cotnrol as Required.

By default, the system recognizes required fields and marks them with this flag. Additionaly, controls can be marked as required event if the bound column is not.

Enabled Formula

Set an expression then will be evaluated during run-time and enable or disable the control.

The expression must be in javascript and should return a boolean value.

Dependencies between controls are automatically identified and the expression is re-calculated every time a control affecting the formula changes.

Example :

Code

form.GetControl("c_Status").GetValue() != "Open" && form.UserInGroup("Administrators")

Visibility Formula

Define a valid formula (using javascript) that will be evaluated during runtime to show or hide the control.

The expression should return a boolean value.

For example :

Code

form.FieldValue("c_Status") != "Rejected" || form.UserID() == "1"

 

Value

Note:

Chart needs data which contains two fields: one field should contain text i.e. months, and another field which contains numbers i.e. income. For an example list, take a look at the following picture:

 

 

To supply data to the Chart Control, use the following options :

  • Chart values will be retrieved from a list query
  • Chart values will be provided by a web service call
  • Chart values will be provided by an SQL query
 
List Query

A List Query that returns text and numbers should be used, like the picture below:

 

To bind the Chart control to the above list query, do the following:

Web Service

The same as above, a web service that returns text and numbers should be used.

SQL Query

Works the same way as ListQueries and Web Service.

 

Layout Properties

Width

Defines the width of the control.

When the value is zero, the maximum allowed width will be used.

Height

Defines the control height.

If the value is zero, the height property will not be set. 

H.Alignment

Defines the horizontal alignment of the parent cell (values : left, right, center)

V.Alignment

Defines the vertical alignment of the parent cell (values : top, bottom, center)

Fore Color

Defines the fore color of the control

Back Color

Defines the Background color of the control.

Cell Color

Defines the color of the parent cell.

Font Size

Declares the font size of the text

Margin

Sets the margin applied to the control, that is, the spacing between the control and the cell borders.

Font Bold

Changes the weight of the font used

Italics

Changes the font style for the control text

 

Lookup Details

No lookup details are used with this control.

Extra Configuration

Type

The chart type. Can be Pie or Bars.

DisplayMember

The field name that represents the display property of the data source, i.e. Months

ValueMember

The field name that represents the value property of the data source (numeric), i.e. Income

Color1

The first color of the bar geadient, i.e. #FCA

Color2

The second color of the bar geadient, i.e. #C70