Show TOC

Configuring ChartsLocate this document in the navigation structure

Developers configure the measures and dimensions displayed in charts by setting the role property to the desired value per chart type. Additional definitions apply to all chart types.

You can use the same annotation file with different qualifiers to present charts with different chart views. You do this by specifying different qualifiers in the annotation file for each card. The following sections of the annotation file apply to all chart types:

  • UI.Identification: Specify the navigation targets activated when the user clicks the card and list the parameters to pass to the target application. This definition is mandatory. For more information, see Configuring Card Navigation.
  • UI.SelectionVariant.SelectOptions: You can specify the filter values that are applied to the card, which are applied when retrieving the card data.

  • UI.PresentationVariant.SortOrder: You can specify the sort order to be used.

  • UI.PresentationVariant.MaxItems: Using this property, you can limit the maximum number of records to be fetched from the backend. If this variant isn't used, then all records from the backend will be displayed in the chart.
    Tip Don't use this for charts that rely on complete data sets; for example, the donut chart card, otherwise the results won't be meaningful.
  • UI.Chart: Specify the dimensions and measures that make up the chart, the chart type, and the way that the measures/dimensions are used for the chart. This definition is mandatory.
    • UI.Chart.MeasureAttributes.Measure annotation: Defines the measures used in the chart.

    • UI.Chart.MeasureAttributes.Role annotation: the manner in which a measure is used within the chart. This is configured differently for each chart type, as described below.

    • UI.Chart.DimensionAttributes.Dimension annotation: the dimensions used in the chart.

    • UI.Chart.DimensionAttributes.Role annotation: the manner in which a dimension is used within the chart.This is configured differently for each chart type, as described below.

Chart Types

This section describes line, donut, bubble, column, stacked column, and vertical bullet charts.

The value assigned to the role property for dimensions and measures in the annotation file determines the visualization of the chart. For dimensions, you can set the role to category or series. If no value is specified, it's defaulted to category.

For measures, you can set the role to values:: axis1, axis2 or axis3. If no value is specified, it's defaulted to axis1. The actual interpretation of the role value specified in the annotation file varies according to the chart type used, as detailed in the following section.

Line Chart

Line charts require at least one measure and one dimension.
  • Dimensions for which the role is set to category, makes up the x-axis (category axis). If no dimension is specified with this role, the first dimension is used as the x-axis. It's recommended to use only time-based dimensions (for example, day, date, week, month, quarter, or year) for the category axis of a line chart.
  • Dimensions for which the role is set to series make up the line segments of the chart, with different colors assigned to each dimension value. If multiple dimensions are assigned this role, the values of all such dimensions together are considered as one dimension and a color is assigned.
  • Measures make up the y- axis (value axis). If there are multiple measures, then each measure is represented by a different colored line inside the chart area.

Donut Chart

Donut charts require exactly one measure. You can provide more than one dimension, in which case they are stacked so that the sections of the chart represent the combination of both dimensions. For example, if you define "Sales" as your measure, and provide two dimensions: "Year" and "Country", the chart will display the sales data of each combination of year and country as a separate colored section.

Bubble Chart

Bubble charts require three measures and at least one dimension, yet allow a maximum of two.
  • The first measure for which the role is set to axis1, or if none exists, the first measure for which the role is set to axis2, or if none exists, the first measure for which the role is set to axis3, is assigned to the feed UID valueAxis. This makes up the X axis.
  • The first measure for which the role is set to axis2, or the second measure for which the role is set to axis1 (if role axis2 does not exist for the first measure), or the first measure for which the role is set to axis3 (if role axis1 does not exist for the second measure), is assigned to the feed UID valueAxis2. This makes up the Y axis.
  • The remaining measure is assigned to feed UID bubbleWidth. This determines the size of the bubble.
  • The dimensions for which the role is set to series are assigned to the feed UID color. Different values for this dimension in the data set result in different colored data points in the chart. If multiples dimensions are set with the category role, only the first dimension is considered. If both dimensions have been assigned the role series then each combination of the dimension member will get a unique color.
    For example, if "Year" and "Country" are the dimensions and both have been assigned the role series then "India/2015", "India/2016", "Germany/2015", "Germany/2016" will be represented as a different colored bubble. If a dimension is not marked with any role, then the dimension members will get the same color. In the above example, if year is not marked with any color, then the bubbles will only have two colors - one for all records of India and one for all records of Germany, irrespective of the year.
    Note Assigning the role of a dimension as category would lead to different shaped data points for different values of the dimension. However, this is not recommended for a bubble chart card. Configuring the role of a bubble chart dimension as category is discouraged
  • The dimensions for which the role is set to category are assigned to the feed UID shape. Different values for this dimension in the data set result in different shaped data points in the chart. If multiples dimensions are set with the category role, only the first dimension is considered.

Following is a code snippet which demonstrates defining a bubble chart card. Note that there are three measures (under the MeasureAttributes property) and one dimension (under the DimensionAttributes property).

Sample Code
<Annotation Term="UI.Chart" Qualifier="Qualifier_ID_1">
<Record Type="UI.ChartDefinitionType">
                                <PropertyValue Property="Title" String="View1" />
                                <PropertyValue Property="ChartType" EnumMember="UI.ChartType/Bubble"/>
                                <PropertyValue Property="MeasureAttributes">
                                                <Collection>
                                                                <Record Type="UI.ChartMeasureAttributeType">
                                                                                <PropertyValue Property="Measure" PropertyPath="SalesShare" />
                                                                                <PropertyValue Property="Role" EnumMember="UI.ChartMeasureRoleType/Axis1" />
                                                                </Record>
                                                                <Record Type="UI.ChartMeasureAttributeType">
                                                                                <PropertyValue Property="Measure" PropertyPath="TotalSales" />
                                                                                <PropertyValue Property="Role" EnumMember="UI.ChartMeasureRoleType/Axis2" />
                                                                </Record>
                                                                <Record Type="UI.ChartMeasureAttributeType">
                                                                                <PropertyValue Property="Measure" PropertyPath="Sales" />
                                                                                <PropertyValue Property="Role" EnumMember="UI.ChartMeasureRoleType/Axis3" />
                                                                </Record>
                                                </Collection>
                                </PropertyValue>
                                <PropertyValue Property="DimensionAttributes">
                                                <Collection>
                                                                <Record Type="UI.ChartDimensionAttributeType">
                                                                                <PropertyValue Property="Dimension" PropertyPath="Product" />
                                                                                <PropertyValue Property="Role" EnumMember="UI.ChartDimensionRoleType/Series" />
                                                                </Record>
                                                 </Collection>
                                </PropertyValue>
                </Record>
</Annotation>

Column Chart

Column charts require at least one measure and one dimension. Irrespective of the role defined for the measure in the annotation file, every measure will be represented as a separate column. Similarly, irrespective of the role defined in the annotation file, every dimension will be added to the category axis (x-axis).

Stacked Column Chart

A stacked column chart is similar to the column chart; however, all measures irrespective of role, get stacked on top of each other. There should be at least one dimension with the assigned role category and all dimensions with this role would be added to the category axis (x-axis). All dimensions with role series also get stacked. It's recommended to either stack based on dimensions or measures, but not mix both in a single chart card.

Vertical Bullet Chart

Vertical bullet charts accept at least one measure and one dimension. All dimensions irrespective of their role will be assigned to the category axis. All measures with role axis1 would be represented as solid colored columns, which represent actual values. All measures with role axis2 would be represented as a solid black line, which represents the target value.