Since version 2 as a style for Arc, version 3 as a style for Line
A stroke pattern with individual segments, which can take specified weights and colors. Of particular use for rendering GOAL_PROGRESS, RANGED_VALUE and WEIGHTED_ELEMENTS complications.
Syntax
<WeightedStroke colors="argb-color-list" thickness="float" weights="weight-list" discreteGap="float" interpolate="boolean" cap="BUTT | ROUND | SQUARE" />
Attributes
The WeightedStroke element has the following attributes:
Required attributes
The following attributes are required:
- colors
- The colors of each element of the weighted stroke, as a space-separated list of hex values, for example: - #FF0000 #00FF00 #0000FF.
- When used to render - GOAL_PROGRESSor- RANGED_VALUEcomplication data that supplies color data, or with- WEIGHTED_ELEMENTS,- colorscan be populated directly with- [COMPLICATION.GOAL_PROGRESS_COLORS],- [COMPLICATION.RANGED_VALUE_COLORS], or- [COMPLICATION.WEIGHTED_ELEMENTS_COLORS].
- thickness
- The thickness of the stroke expressed as a float dimension. - This attribute is transformable. 
Optional attributes
The following attributes are optional:
- weights
- A space-separated list of values, which determine the proportion of the arc or line taken up by each weight, for example - 1.0 2.0 3.0, where the third element takes up 3 times the angle or length of the first element.
- When used to represent data from - WEIGHTED_ELEMENTScomplication, the- [COMPLICATION.WEIGHTED_ELEMENTS_WEIGHTS]can be passed in directly.
- discreteGap
- When used on an arc, the angle between each element. When used on a line, the length between each element. Defaults to - 0.0.
- interpolate
- When set to - true, each element N from the- weightslist has a color gradient from color N to color N+1 of the- colorslist, as opposed to a solid color.
- When used to represent data from - GOAL_PROGRESSor- RANGED_VALUEcomplications, you can pass in values for the- [COMPLICATION.GOAL_PROGRESS_COLORS_INTERPOLATE]or- [COMPLICATION.RANGED_VALUE_COLORS_INTERPOLATE]fields directly. When used in representing- WEIGHTED_ELEMENTScomplication data, set- interpolateto- false.
- Defaults to - false.
- cap
- Determine the shape of the edge of the stroke. Supported values are: - BUTTcauses the stroke to end with the path, and not project beyond it.
- ROUNDcauses the stroke to project out as a semicircle, with the center at the end of the path.
- SQUAREcauses the stroke to project out as a square, with the center at the end of the path.
 
Inner elements
The WeightedStroke element can contain the following elements:
Recommended for you
- Note: link text is displayed when JavaScript is off
- WeightedStroke
- Complication
- Stroke
