Parameter Substitution Properties

CorasWorks utilizes a product called Chart Director to maintain charts. Because of this, some of portions of this help will mention the Chart Director product. Chart Director creates each chart and the CorasWorks web part then displays the chart to the user.

By default, these settings will be set up for a standard Task list the first time you choose a chart.

ChartDirector uses parameter substitution to allow you to configure precisely the information contained in the text and their format. For example, when drawing a pie chart with side label layout, the default sector label format is:
{label} ({percent}%)

In drawing the sector labels, ChartDirector will replace "{label}" with the sector name, and "{percent}" with the sector percentage. So the above label format will result is a sector label similar to "ABC (34.56%)."

You can change the sector label format by changing the format string. For example, you can change it to:
{label}: US${value}K ({percent}%)

The sector value will then become something like "ABC: US$123 (35.56%)."

In general, in ChartDirector parameter substitution, fields enclosed by curly brackets will be substituted with their actual values when creating the texts.

ChartDirector supports parameter expressions. They are fields enclosed by curly brackets and they start with the "=" character. For example:
USD {value} (Euro {={value}*0.9})

In the above example, "{value}" will be substituted with the actual value of the sector. The expression "{={value}*0.9}" will be substituted with the actual value of the sector multiplied by 0.9.

ChartDirector parameter expressions support operators "+", "-", "*", "/" and "^" (exponentiation). The *, /, and ^ operators are computed first, followed by + and -. Operators of the same precedence are computed from left to right. Parenthesis can be used to change the computation order.

For fields that are numbers or dates/times, ChartDirector supports a special syntax in parameter substitution to allow these values to be formatted. Please refer to the Number Formatting and Date/Time Formatting sections below for details.

 

The following tables describe the fields available for various chart objects.

Parameters for Pie Charts

Parameter

Description

sector

The sector number. The first sector is 0, while the nth sector is (n-1).

dataSet

Same as {sector}. See above.

label

The text label of the sector.

dataSetName

Same as {label}. See above.

value

The data value of the sector.

percent

The percentage value of the sector.

field{N}

The (N + 1)th extra field (the first extra field is field0).

 

Parameters for All XY, Bar, Gantt Chart Layers

The followings parameters apply to all XY chart layers in general. Some layer types may have additional parameters (see below).

Note that certain parameters are inapplicable in some contexts. For example, when specifying the aggregate label of a stacked bar chart, the {dataSetName} parameter is inapplicable. This is because a stacked bar is composed of multiple data sets. It does not belong to any particular data set and hence does not have a data set name.

Parameter

Description

x

The x value of the data point. For an enumerated x-axis, the first data point is 0 and the nth data point is (n-1).

xLabel

The bottom x-axis label of the data point.

x2Label

The top x-axis label of the data point.

value

The value of the data point.

percent

The percentage of the data point based on the total value of all data points.

dataGroup

The data group number to which the data point belongs. The first data group is 0. The nth data group is (n-1).

dataGroupName

The name of the data group to which the data point belongs.

Number Formatting

For parameters that are numeric, ChartDirector supports a number of formatting options in parameter substitution.

For example, say you want a numeric field {value} to have a precision of two digits to the right of the decimal point, use a comma as the thousand separator and use a period as the decimal point. In this example, you would use {value|2,.}. The number 123456.789 will then be displayed as 123,456.79.

For numbers, the formatting options are specified using the following syntax:

{[param]|[a][b][c][d]}

where:

Parameter

Description

[param]

The name of the parameter

[a]

An integer specifying the number of digits to the right of the decimal point. The default is automatic. To use the default, simply skip this parameter.

[b]

The thousand separator. This should be a non-alphanumeric character (not 0-9, A-Z, a-z). Use '~' for no thousand separator. The default is '~', which can be modified using BaseChart.setNumberFormat.

[c]

The decimal point character. The default is '.', which can be modified using BaseChart.setNumberFormat.

[d]

The negative sign character. Use '~' for no negative sign character. The default is '-', which can be modified using BaseChart.setNumberFormat.

 

You may skip the trailing formatting options if they are needed. For example, {value|2} means format the value with two digits to the right, where the thousand separator, decimal point character, and negative sign character all use the default settings of the chart.

Date/Time Formatting

For parameters that are dates/times, the formatting options can be specified using the following syntax:

{[param]|[datetime_format_string]}

where [datetime_format_string] must start with an English character (A-Z or a-z), and may contain any characters except '}'. Certain characters are substituted according to the following table:

Parameter

Description

yyyy

The year in 4 digits (e.g. 2002)

yyy

The year showing only the least significant 3 digits (e.g. 002 for the year 2002)

yy

The year showing only the least significant 2 digits (e.g. 02 for the year 2002)

y

The year showing only the least significant 1 digits (e.g. 2 for the year 2002)

mmm

The month formatted as its name. The default is to use the first 3 characters of the English month name (Jan, Feb, Mar, etc.). The names can be configured using BaseChart.setMonthNames.

mm

The month formatted as 2 digits from 01 - 12, adding a leading zero if necessary.

m

The month formatted using the minimum number of digits from 1 - 12.

dd

The day of month formatted as 2 digits from 01 - 31, adding a leading zero if necessary.

d

The day of month formatted using the minimum number of digits from 1 - 31.

w

The name of the day of week. The default is to use the first 3 characters of the English day of week name (Sun, Mon, Tue, etc.). The names can be configured using BaseChart.setWeekDayNames.

hh

The hour of day formatted as 2 digits, adding a leading zero if necessary. The 2 digits will be 00 - 23 if the 'a' option (see below) is not specified, otherwise it will be 00 - 12.

h

The hour of day formatted using the minimum number of digits. The digits will be 0 - 23 if the 'a' option (see below) is not specified, otherwise it will be 0 - 12.

nn

The minute formatted as 2 digits from 00 - 59, adding a leading zero if necessary.

n

The minute formatted using the minimum number of digits from 00 - 59.

ss

The second formatted as 2 digits from 00 - 59, adding a leading zero if necessary.

s

The second formatted using the minimum number of digits from 00 - 59.

a

Display either 'am' or 'pm,' depending on whether the time is in the morning or afternoon. The 'am' and 'pm' text can be modified using BaseChart.setAMPM.

 

For example, a parameter substitution format of {value|mm-dd-yyyy} will display a date as something similar to 09-15-2002. A format of {value|dd/mm/yy hh:nn:ss a} will display a date as something similar to 15/09/02 03:04:05 pm.