Various aspects of charts can be configured. This is accomplished by setting the CONFIG attribute on the UIM field in question. The appropriate XML configuration file must contain a configuration section with a unique identifier matching the text in the CONFIG attribute.
All the necessary chart configuration files are to be in your component directory.
Different types of charts are currently configured in separate configuration files:
The following is a sample of a chart configuration file:
<CHART-CONFIG> <CONFIG ID="Column.Chart.Config" ORIENTATION="VERTICAL" X_AXIS_LABEL="Vert.BarChart.X-Axis" Y_AXIS_LABEL="Vert.BarChart.Y-Axis"> <LEGEND CODETABLE="Attendance"> <ITEM CODE="CR1"/> <ITEM CODE="CR2"/> <ITEM CODE="CR3"/> </LEGEND> <LINK LOCATION="ComponentRedirect"> <PARAMETER NAME="vertID" VALUE="ID" USE_PAGE_PARAM="false"/> <PARAMETER NAME="dueDate" VALUE="START_DATE" USE_PAGE_PARAM="false"/> <PARAMETER NAME="transID" VALUE="ID" USE_PAGE_PARAM="true"/> </LINK> <CAPTION_LINK LOCATION="AnotherPage"> <PARAMETER NAME="vertID" VALUE="ID" USE_PAGE_PARAM="false"/> <PARAMETER NAME="dueDate" VALUE="START_DATE" USE_PAGE_PARAM="false"/> <PARAMETER NAME="transID" VALUE="ID" USE_PAGE_PARAM="true"/> </LINK> </CONFIG> <CONFIG ID="BarChart.Config" ORIENTATION="HORIZONTAL" CAPTION="Status.Caption" CAPTION_TEXT_CODETABLE="Cars" MIN_HEIGHT="200" MAX_HEIGHT="500"> <LEGEND VISIBLE="true" CODETABLE="OldCars"> <ITEM CODE="CR1"/> ... </LEGEND> <LINK LOCATION="TransferPage"> <PARAMETER NAME="horID" VALUE="ID" USE_PAGE_PARAM="false"/> ... </LINK> </CONFIG> <CONFIG ID="BarChart.Config" TYPE="line" CAPTION="Line.Chart.Caption"> <LEGEND> <ITEM CODE="CR1"/> ... </LEGEND> <LINK LOCATION="ComponentRedirect"> <PARAMETER NAME="horID" VALUE="ID" USE_PAGE_PARAM="false"/> ... </LINK> </CONFIG> </CHART-CONFIG>
The CHART-CONFIG root element contains only CONFIG elements. The CONFIG element contains all configuration for a particular field, identified by the ID attribute. The following table describes all attributes of the CONFIG element. BarChart.properties referred to in this table is a properties file in the client application's <CLIENT_DIR>\components\core folder, used to look up values required.
Attribute | Description |
---|---|
ID | Unique identifier for this CONFIG element. |
TYPE | Can be either line or pie, depending on required type of chart. If not present, ORIENTATION attribute will be used to define if bar or column chart is to be displayed. |
ORIENTATION | Can be either HORIZONTAL or VERTICAL, depending on required type of chart, HORIZONTAL meaning bar chart and VERTICAL - column chart. |
CAPTION_TEXT_CODETABLE | Code table currently used for label captions throughout a chart. If not specified, literal values from chart data will be used. |
MAX_VALUE | Maximum value for a numeric axis of column or bar chart. Automatically calculated to fit the maximum element, if not specified. |
MAX_INCREMENT | Maximum increment value for a numeric axis of a chart. Numbered ticks are drawn on a chart at the specified intervals. If not specified, numbered ticks are placed at uniform intervals along the numeric axis, taking into account it's maximum value. |
X_AXIS_LABEL | Key to a text property in BarChart.properties. This text is used as the label for the x-axis in the column or line chart, or y-axis in the bar chart. Not used on pie chart. |
Y_AXIS_LABEL | Key to a text property in BarChart.properties. This text is used as the label for the y-axis in the column or line chart, or x-axis in the bar chart. Not used on pie chart. |
MIN_HEIGHT | This setting is used to define minimum chart object height and is to be specified in pixels. Where a chart contains a small number of items and would be short based on that content size, minimum height introduced by this setting is used. The setting is optional, so 250px default minimum height is used if MIN_HEIGHT is not specified. |
MAX_HEIGHT | This setting is used to define the maximum chart object height on screen and should be specified in pixels. Where a chart contains numerous items and its contents exceeds the MAX_HEIGHT specified, this setting is used for the chart object height and a vertical scrollbar appears to allow for access to the rest of the items in the chart. The setting is optional and a default of 250px is used if the attribute is not specified. A value of -1 for MAX_HEIGHT means that the chart takes whichever height its content needs to be displayed in full. It is worth noting that the minimum height setting, either default or explicit, is still taken into account in this case. As a result, charts with little content will not be shorter than minimum or default height implies. Finally, a chart with MAX_HEIGHT set to -1 will not display its vertical scrollbar and the browser scrollbar will appear once the chart is too big to fit into the screen area available. |
CAPTION | Key to a text property in BarChart.properties. This text is used as the label for the whole chart. |
The older versions of BarChartConfig.xml do not contain configuration for label links. This element might be added, if required to this file directly; it is preferable, though, to create appropriate full configuration with the same ID in the ChartConfig.xml which will override the older version.
MIN_HEIGHT and MAX_HEIGHT settings currently do not apply to line or pie charts and will be ignored for these types.
The CONFIG element has three child elements: LEGEND, LINK and optional CAPTION_LINK.
The ITEM child element of specifies each legend entry. Its CODE attribute is the text or code table code used to identify a legend item. The code table containing the CODE value will be ascertained first from the CAPTION_TEXT_CODETABLE value of the CONFIG element, then the CODETABLE attribute on the LEGEND element value, or, in case neither of these attributes are present or do not apply to a particular CODE, the literal value will be used as a caption. The same caption is used for a context data tip displayed when mouse pointer is over a corresponding chart element.
Texts for chart caption and axes labels can be customized and localized by creating a properties file called BarChart.properties in the client application's <CLIENT_DIR>\components\core folder and placing there values under keys, corresponding to the ones specified among CONFIG element parameters as described above.
In addition, the text displayed for the word total displayed in the bar tool-tips is customizable using the key total.tooltip.text in the BarChart.properties file.