Chart widget tags

This page describes an older version, please read about the latest version at:

Configuration file for the Chart widget

The general structure of the Chart widget configuration file is shown by the conceptual graphic below.

Conceptual overview of configuration options for Chart widget

The file is defined by a <configuration> tag that identifies it as a configuration file for the Viewer. It supports editing the charts in the widget and also enables the widget dialog labels to be changed. It has the following child tags:

Container for the widget chart layer sources. It has the following child tag:
Specifies the input layer for a chart. Each searchable layer will have its own <layer> tag. It has the following properties and child tags:
  • label—the label of the layer. Use when the layer already exists in the map. The layer must be a feature layer. This is the same label as specified in the main configuration file for the layer to use.
  • url—the uniform resource locator (URL) address of the layer to query for data. Use when the layer does not exist in the map. This is an individual layer within a service and normally ends with a number, such as .../MapServer/0.
This field will be used as the chart's category field. For example, if the label field is 'NAME' then this field will be used to categorize the chart data. Required.
Container for the retrieved fields. It has the following child tag:
Specific field to be retrieved. It has the following attribute:
  • name—Name of the attribute field on the server side.
Which medias to display. It has one child tag:
Information for how to display media in the Chart widget. This tag has the following attributes:
  • caption—Supports statistic value substitution using the following syntax. See example at the end of this page.
    • {=SUM}
    • {=MIN}
    • {=MAX}
    • {=COUNT}
    • {=AVERAGE}
  • chartfields—Field name (one single field per chart) for data shown in chart. Required.
  • chartnormalizationfield—Value to divide the chart fields value by. Optional.
  • title—Title to display. Optional.
  • type—Type of chart to display. Required. Valid values are:
    • barchart
    • columnchart
    • linechart
    • piechart


In addition, the configuration file also supports changing the labels used in the widget dialog (this is not shown in the conceptual graphic).

Container for labels that can be modified in this widget. It has several child tags:
Tooltip for the first titlebar button (default for English is Select).
Tooltip for the second titlebar button (default for English is Results).
Label for layer selection list (default for English is Select layer).
Label for draw tool selection icon group (default for English is Select draw tool).
Label displayed when there are no layers for charting (default for English is No layers).
Label displayed when there chart has no data (default for English is No chart data to display).
Label displayed when the selected layer is not visible or is out of scale (default for English is "feature layer is either not visible or out of scale range").
Tooltip label for the select by rectangle tool (default for English is Draw Rectangle).
Tooltip label for the select by circle tool (default for English is Draw Circle).
Tooltip label for the select by ellipse tool (default for English is Draw Ellipse).
Tooltip label for the select by polygon tool (default for English is Draw Polygon).
Tooltip label for the select by freehand polygon tool (default for English is Draw Freehand Polygon).
Label for the clear selection graphics (default for English is Clear).

Example configuration file:

        <layerselectionlabel>Select layer</layerselectionlabel>
        <drawtoolmenulabel>Select draw tool</drawtoolmenulabel>
        <!-- The label of this layers refer to a layer added in the main configuration file-->
        <layer label="USA Diversity Index">
                <field name="NAME"/>
                <field name="DIVINDX_CY"/>
                <media caption="You selected {=COUNT} features"
                       title="Diversity Index"
        <layer label="Age statistics" url="">
                <field name="NAME"/>
                <field name="MEDAGE_CY"/>
                <field name="POPU5_CY"/>
                <field name="POP85_CY"/>
                <media caption="The average median age for these {=COUNT} features is {=AVERAGE}"
                       title="Median Age"
                <media caption="Together these {=COUNT} counties have {=SUM} people in the 0-4 age range"
                       title="2010 Population, Age 0-4 Years"
                <media chartfields="POP85_CY"
                       title="2010 Population, Age 85 Years or Older"

        <!-- This layer from a MapService is not drawn on the map but can still be selected from. -->
        <layer label="Income by state" url="">
                <field name="NAME"/>
                <field name="TOTPOP_CY"/>
                <field name="MEDHINC_CY"/>
                <!-- This example shows the four different types of chart: "barchart", "columnchart", "linechart", "piechart" -->
                <media chartfields="TOTPOP_CY"
                       title="Total Population (pie chart)"
                <media chartfields="MEDHINC_CY"
                       title="Median Household Income (bar chart)"
                <media chartfields="MEDHINC_CY"
                       title="Median Household Income (line chart)"
                <media chartfields="MEDHINC_CY"
                       title="Median Household Income (column chart)"

Test drive the Chart widget.