Annotations References
This article covers the exhaustive set of attributes and macros supported by annotations in FusionCharts Suite XT.
General Configuration Attributes
The root annotations
object accepts a number of attributes for configuring generic aspects of annotations globally.
These attributes are defined using the code structure shown below:
Attribute Name | Description |
---|---|
|
Specifies whether the annotation group will automatically scale, if chart dimensions change. Setting this attribute to |
|
Specifies whether annotations will retain their aspect ratio (the height:width ratio) when scaled. Setting this attribute to |
|
Specifies whether text annotations in an annotation group will automatically scale, if chart dimensions change. Setting this attribute to |
|
Specifies whether image annotations in an annotation group will automatically scale, if chart dimensions change. Setting this attribute to |
|
The value of this attribute is added to the x coordinate position value of the final annotation items on the x-axis. In other words, if an annotation is placed at 100 pixels left and the value of |
|
Like the |
|
Shifts all annotation groups along the x coordinate. The difference between |
|
Like the |
|
Specifies the original width of the chart, in which the annotation renders as intended. It is used as the reference width while automatically scaling annotations, in the event that a chart is resized. |
|
Specifies the original height of chart, in which the annotation renders as intended. It is used as the reference height while automatically scaling annotations, in the event that a chart is resized. |
Configuration Attributes for Annotation Groups
Annotation groups accept a number of attributes to uniformly configure all annotation items contained within them. Default values for group attributes are inherited from the ones defined as root-level annotation attributes.
These attributes are defined using the code structure shown below:
Attribute Name | Description |
---|---|
|
Specifies a unique identification string for the annotation group. |
|
Specifies the x coordinate of the starting position of the group with respect to the leftmost position (taken as 0) of the chart. If it is also configured individually for the annotation item(s) within the group, then the value of the |
|
Specifies the y coordinate of the starting position of the group with respect to the topmost position (taken as 0) of the chart. If it is also configured individually for the annotation item(s) within the group, then the value of the |
|
Specifies whether the annotation group will automatically scale, if chart dimensions change. Setting this attribute to |
|
Specifies whether text annotations in an annotation group will automatically scale, if chart dimensions change. Setting this attribute to |
|
Specifies whether image annotations in an annotation group will automatically scale, if chart dimensions change. Setting this attribute to |
|
Specifies whether annotations will retain their aspect ratio (the height:width ratio) when scaled. Setting this attribute to |
|
Specifies whether the annotation group will overlap the data plots. Setting this attribute to |
|
Specifies the original width of the chart, in which the annotation renders as intended. It is used as the reference width while automatically scaling annotations, in the event that a chart is resized. |
|
Specifies the original height of chart, in which the annotation renders as intended. It is used as the reference height while automatically scaling annotations, in the event that a chart is resized. |
|
The value of this attribute is added to the x coordinate position value of the final annotation items on the x-axis. In other words, if an annotation is placed at 100 pixels left and the value of |
|
Like the |
|
Shifts all annotation groups along the x coordinate. The difference between |
|
Like the |
|
Specifies the transparency for the group. This attribute takes values between 0 (transparent) and 100 (opaque, default). |
|
Specifies the visibility of the group. Setting this value to |
|
Specifies whether a shadow effect will be shown for the annotation group. Setting this attribute to |
|
Specifies the hex color code for the annotation group. |
|
Specifies the font family for the text annotation(s) in the annotation group. |
|
Specifies the font size for the text annotation(s). |
|
Specifies the horizontal alignment for the text annotation(s). |
|
Specifies the vertical alignment for the text annotation(s). |
|
Specifies whether the text annotation(s) will be rotated. This attribute takes |
|
Specifies whether words that are too long to fit in a line should be wrapped to the next line. Setting this attribute to |
|
Specifies the URL to which the user will be redirected, if the annotation group is clicked. |
|
Specifies the tooltip for the annotation group. |
Configuration Attributes for Annotation Items
These attributes are defined using the code structure shown below:
{
"annotations": {
"groups": [{
"items": [{
//Define the annotation items configuration attributes here.
}]
}]
}
}
For simplicity, the annotation items configuration attributes are segregated into:
-
Common attributes (that work for all annotation types)
-
Ad hoc attributes (that work for only certain annotation types)
Common Attributes
Attribute Name | Description |
---|---|
|
Specifies a unique identification for the annotation. This |
|
Specifies the type of annotation to be drawn. |
|
Specifies the hex color code for the annotation. For example, a value of |
|
Specifies the transparency of the annotation. This attribute takes values between 0 (transparent) and 100 (opaque, default). |
|
Specifies a list of hex color codes, if the group has to be rendered with a gradient effect. For example, |
|
Specifies the transparency of the colors specified using the In case the number of values is less than the number of colors provided, the last of the comma-separated values is repeated for the remaining colors. |
|
Specifies the ratio for distribution for all colors specified as a comma-separated list to the In case the number of ratio values is less than the number of colors provided, the last of the comma-separated values is repeated for the remaining colors. The summation of these values should not exceed 100. |
|
For a gradient |
|
Specifies whether the gradient fill will be |
|
Specifies whether a border will be shown around the annotation. Setting this attribute to |
|
Specifies the hex color code for the annotation border. For example, setting this attribute to |
|
Specifies the transparency of the annotation border. This attribute takes values between 0 (transparent) and 100 (opaque, default). |
|
Specifies the thickness of the annotation border, in pixels. Default value is 2 pixels. |
|
Specifies whether the annotation border will be drawn using dashed lines. Setting this attribute to |
|
Specifies the length of each dash, if a dashed border is drawn for the annotation. |
|
Specifies the gap between each dash, if a dashed border is drawn for the annotation. |
|
Specifies the tooltip for annotation items that is shown when the mouse pointer is hovered over it. |
|
Specifies the URL to which the user will be redirected, if the annotation item is clicked. |
|
Specifies whether a shadow effect will be shown for the annotation group. Setting this attribute to |
Ad Hoc Attributes
Line
Attribute Name | Description |
---|---|
|
Set this attribute to |
|
Specifies the x coordinate of the starting position of the line with respect to the leftmost position (taken as zero) of the chart. |
|
Specifies the y coordinate of the starting position of the line with respect to the topmost position (taken as zero) of the chart. |
|
Specifies the x coordinate of the ending position of the line with respect to the leftmost position (taken as zero) of the chart. |
|
Specifies the y coordinate of the ending position of the line with respect to the topmost position (taken as zero) of the chart. |
|
Specifies the thickness of the line, in pixels. |
Circle
Attribute Name | Description |
---|---|
|
Set this attribute to |
|
Specifies the x coordinate of the center of the circle with respect to the leftmost position (taken as zero) of the chart. |
|
Specifies the y coordinate of the center of the circle with respect to the topmost position (taken as zero) of the chart. |
|
Specifies the radius of the circle, in pixels. |
|
Specifies the height, in pixels, if you want to draw an oval annotation. |
|
Specifies the start angle (in degrees), if a circle has to be drawn like a wedge. For example, setting |
|
Specifies the end angle (in degrees), if a circle has to be drawn like a wedge. |
Arc
Attribute Name | Description |
---|---|
|
Set this attribute to |
|
Specifies the x coordinate of the center of the arc with respect to the leftmost position (taken as zero) of the chart. |
|
Specifies the y coordinate of the center of the circle with respect to the topmost position (taken as zero) of the chart. |
|
Specifies the outer radius of the arc, in pixels. |
|
Specifies the inner radius of the arc, in pixels. |
|
Specifies the starting angle of the arc. This attribute takes values between 0 and 360. The default value is 0. |
|
Specifies the ending angle of the arc. This attribute takes values between 0 and 360. The default value is 360. |
Rectangle
Attribute Name | Description |
---|---|
|
Set this attribute to |
|
Specifies the x coordinate of the starting position of the rectangle with respect to the leftmost position (taken as zero) of the chart. |
|
Specifies the y coordinate of the starting position of the rectangle with respect to the topmost position (taken as zero) of the chart. |
|
Specifies the x coordinate of the ending position of the rectangle with respect to the leftmost position (taken as zero) of the chart. |
|
Specifies the y coordinate of the ending position of the rectangle with respect to the topmost position (taken as zero) of the chart. |
|
Specifies the radius of the edges of a rectangle, in pixels. This attribute is used when you want to render the annotation as a rounded rectangle. |
Polygon
Attribute Name | Description |
---|---|
|
Set it to |
|
Specifies the number of sides for the polygon. Its value must be greater than 2. |
|
Specifies the x coordinate of the center of the polygon with respect to the leftmost position (taken as zero) of the chart. |
|
Specifies the y coordinate of the center of the polygon with respect to the topmost position (taken as zero) of the chart. |
|
Specifies the radius of the edges of a polygon, in pixels. |
Text
Attribute Name | Description |
---|---|
|
Set this attribute to |
|
Specifies the text that is to be rendered as the annotation. |
|
Specifies the x coordinate of the position of the text annotation with respect to the leftmost position (taken as zero) of the chart. |
|
Specifies the y coordinate of the position of the text annotation with respect to the topmost position (taken as zero) of the chart. |
|
Specifies the font family for the text annotation. |
|
Specifies the font size for the text annotation. |
|
Specifies the horizontal alignment of the text annotation. This attribute takes |
|
Specifies the vertical alignment of the text annotation. This attribute takes |
|
Specifies whether the text will be in bold. Setting this attribute to |
|
Specifies whether the text will be in italic. Setting this attribute to |
|
Specifies the hex color code for the text annotation’s background. For example, a value of |
|
Sets a fixed margin, in pixels, to the left of the text. |
|
Specifies whether the text annotation(s) will be rotated. This attribute takes |
|
Specifies whether text wrapping will be enabled. Setting this attribute to |
|
Specifies the width wrapping dimension for the text. When this width is reached, it will cause the text to break into a new line. |
|
Like the |
Path
Attribute | Description |
---|---|
|
Set this attribute to |
|
Specifies the path command and accepts standard SVG path format. For example, the path command “M 10, 10, L 100, 100” signifies that we start drawing from the coordinate at (10,10) pixel using M ( Move to) command and draw a line up to the coordinate (100,100) pixel as specified by the L (Line to) command. |
|
Specifies the x coordinate of the starting position of the path with respect to the leftmost position (taken as 0) of the chart. |
|
Specifies the y coordinate of the starting position of the path with respect to the topmost position (taken as 0) of the chart. |
Images
Attribute | Description |
---|---|
|
Set this attribute to |
|
Specifies the location of the image file (jpeg, png, or gif) that is to be rendered on the chart. |
|
Specifies the x coordinate of the starting position of the image annotation with respect to the leftmost position (taken as 0) of the chart. |
|
Specifies the y coordinate of the starting position of the image annotation with respect to the topmost position (taken as 0) of the chart. |
|
Specifies the resize value for the image width. |
|
Specifies the resize value for the image height. |
Macros Supported for Positioning Annotations in Charts and Gauges
Macro Name | Usage |
---|---|
$chartStartX, $chartStartY, $chartEndX, $chartEndY, $chartCenterX, $chartCenterY, $chartWidth, $chartHeight |
Define the annotation position attributes - |
$chartTopMargin, $chartBottomMargin, $chartLeftMargin, $chartRightMargin |
Position the annotations with respect to the chart margins. |
$captionStartX, $captionStartY, $captionEndX, $captionEndY, $captionWidth, $captionHeight, $subCaptionStartX, $subCaptionStartY, $subCaptionEndX, $subCaptionEndY, $subCaptionWidth, $subCaptionHeight |
Position the annotation relative to the chart caption and sub-caption. |
$canvasStartX, $canvasStartY, $canvasEndX, $canvasEndY, $canvasWidth, $canvasHeight |
Position annotations with respect to the canvas. These macros are applicable to cartesian charts. |
$legendStartX, $legendStartY, $legendEndX, $legendEndY, $legendWidth, $legendHeight |
Position annotations around a legend. These macros are applicable to cartesian charts. |
$gaugeStartX, $gaugeStartY, $gaugeEndX, $gaugeEndY, $gaugeCenterX, $gaugeCenterY |
Position annotations around gauges. |
$gaugeStartAngle, $gaugeEndAngle |
Position annotations with respect to the start angle and end angle of an angular gauge. |
$gaugeRadius |
Position annotations with respect to the radius of a bulb gauge. |
$plotWidth |
Position annotations with respect to the width of the entire funnel or pyramid plot. |
$plotSemiWidth |
Position annotations with respect to half-width of the entire funnel or pyramid plot. |
Sub-token Macros for Positioning with Respect to the Dataset and Axes
Macro Name | Sub Tokens Applicable | Description | Notes |
---|---|---|---|
$dataset |
dataset_index [separator] set [separator] set_index [separator] position_key |
Lets you add the position information of the plots in a dataset to the annotation. |
Possible position_key values are X, Y, STARTX, STARTY, ENDX, ENDY, CENTERX, CENTERY. For example, to position a rectangle above the second column in a column chart, the possible values could be: |
$yaxis |
yaxis_index [separator] label [separator] label_index [separator] position_key |
Lets you add the position information of the y-axis labels to the annotation. |
Possible position_key values are X, Y, STARTX, STARTY, ENDX, ENDY, CENTERX, CENTERY. For example, to position a text on the y axis, the possible values could be: |
$xaxis |
xaxis_index [separator] label [separator] label_index [separator] position_key |
Lets you add the position information of the x-axis labels to the annotation. |
Possible position_key values for this macro are the same as that for the For example, to position a text on the x axis, the possible values could be: |