Adding Markers
Charts that include axes also allow the use of markers. Markers are colored regions of the chart area that help put the displayed value into context. For example, you could display a line chart of the evolution of the main indicator for your project and use markers to visually associate the value of the indicator with its level, as shown below:
<chart type="Histogram" id="MARKERS_EXAMPLE" targetArtefactTypes="FILE" nbBars="10">
<measure color="WHITE">LC</measure>
<markers>
<marker fromIndicator="LC" alpha="150" isVertical="true" />
</markers>
</chart>
Simpler markers can be drawn as vertical or horizontal lines, as shown below:
<chart type="OptimizedBar" id="MARKERS_VERTICAL_EXAMPLE" asPercentage="false">
<measure color="0,81,0">A_FILE</measure>
<measure color="3,127,3">B_FILE</measure>
<measure color="133,182,2">C_FILE</measure>
<markers>
<marker value="50" endValue="100" color="RED" alpha="150" isVertical="false" />
</markers>
</chart>
There are five ways to include markers on a chart:
-
By using a scale ID to apply coloring to the entire background for all available scale levels. See the
fromScaleattribute below. -
By using an indicator ID to apply coloring to the entire background for all available scale levels associated to the indicator. See the
fromIndicatorattribute below. -
By specifying a metric to display its goal for each milestone in the project. See the
fromMilestonesGoalattribute below. -
By requesting to display a marker for the dates of all milestones in the project. See the
fromMilestonesattribute below. -
By manually specifying the start and end values on the axes, and the color of the marker you want. See the
value,endValueandcolorattributes below.
The marker element has the following attributes:
-
fromScale(optional, not compatible withvalue/endValue) sets the scale to use to create a markers for each scale level using the color defined in the scale’s properties. -
fromIndicator(optional) sets the indicator to use to retrieve a scale and create a markers for each scale level using the color defined in the scale’s properties. -
fromMilestonesGoal(optional) draws markers for all the metric goals in the project. You can find an example in Milestone-based markers. -
fromMilestones(optional) draws markers for all milestone dates in the project. You can find an example in Milestone-based markers. -
value(optional, default: -infinity, cannot be combined withfromIndicator,fromScale,fromMilestonesGoal, orfromMilestones) sets the position on the axis to start drawing the marker from. You can specify an exact value, a percentage, or a computation for this parameter. -
endValue(optional, default: infinity, cannot be combined withfromIndicator,fromScale,fromMilestonesGoal, orfromMilestones) sets the position on the axis to stop drawing the marker. You can specify an exact value, a percentage, or a computation for this parameter. Ignored ifisIntervalis set to false. -
isInterval(optional, default: true, cannot be combined withfromIndicatororfromScale) allows defining whether a marker covers an interval (true) or is simply a line on the chart (false). -
stroke(optional, default: SOLID) defines the appearance of the line. Ignored ifisIntervalis set to true. The supported values are:-
SOLID
-
DOTTED
-
-
strokeWidth(optional, default: 1.0) defines the width of the line. Ignored ifisIntervalis set to true. -
color(optional, default: GREY, not compatible withfromIndicatororfromScale) is the color code used to fill the marker region (Working With Colors). -
alpha(optional, default: 50) sets the opacity level (0 is transparent, 255 is fully opaque). -
isVertical(optional, default: false) specifies if the marker should be vertical (true) or horizontal (false). -
label(optional, default: none) allows specifying a label for the marker:When attributes
valueand/orendValueare used, you can display their actual value in the label. Syntax is the following:-
If
valueis defined, use variable{value}in thelabelstring definition. -
If
endValueis defined use variables{start}and{end}in thelabelstring definition.
-
-
labelColor(optional, default: BLACK) allows specifying the color of the label text (Working With Colors). -
labelFontSize(optional, default: 9) defines the size of the label text. -
labelFontStyle(optional, default: PLAIN) defines the style of the label text. Supported values are:-
PLAIN
-
BOLD
-
ITALIC
-
BOLD_ITALIC
-
-
labelAnchor(optional, default: TOP_RIGHT if vertical, TOP_LEFT if horizontal) defines the position of the label relative to the marker. The possible values are:-
BOTTOM
-
BOTTOM_LEFT
-
BOTTOM_RIGHT
-
CENTER
-
LEFT
-
RIGHT
-
TOP
-
TOP_LEFT
-
TOP_RIGHT
-
-
labelTextAnchor(optional, default: TOP_LEFT if vertical, BOTTOM_LEFT if horizontal) defines the position of the text relative to the label. The possible values are:-
BASELINE_CENTER
-
BASELINE_LEFT
-
BASELINE_RIGHT
-
BOTTOM_CENTER
-
BOTTOM_LEFT
-
BOTTOM_RIGHT
-
CENTER
-
CENTER_LEFT
-
CENTER_RIGHT
-
HALF_ASCENT_CENTER
-
HALF_ASCENT_LEFT
-
HALF_ASCENT_RIGHT
-
TOP_CENTER
-
TOP_LEFT
-
TOP_RIGHT
-