All datapoints, series, and other rendered objects in charts can be annotated with hyperlink, description, and other information. Annotations can be defined with:
The capabilities of different annotation mechanisms differ. The <annotation> tag and paint both are not limited to a certain set of annotation information. However, possible macros are expanded only if the information is given with the <annotation/> tag. Alt and url channels can only give the description and hyperlink of annotation, respectively. The importance order of given annotations is in decreasing order:
The
<annotation/> tag has only one attribute href.
The href attribute determines the hyperlink of annotation.
The notation for marking a hyperlink is different for example for SVG images and HTML imagemaps,
but the Davisor Chart takes care of choosing the correct notation.
Two different child tags can be present in the <annotation/> tag. These child tags are:
The description of annotation is given in the body of the
<text/> tag. As with href attribute, the Davisor
Chart takes care of choosing the correct notation for the description
of annotation.
With the <attr/> tag, any information for annotation can be
given. The information is given with name and
value attribute pairs in the <attr/> tag. The
values of the name and value attributes are
transferred to the resulting chart. Possible macros in the value of
the value attribute are expanded. The number of
<attr/> tags in one <annotation/> tag is not limited.
If there are many <annotation/> tags in the same level, the information of the tags is combined. If the tags have same information, later tags override values given in the previous tags. Same level here means, for example, a <plot/> tag that has multiple <annotation/> tags.
Data point annotations are given with annotation element that is placed inside a plot element. If you like to give special annotation to certain data series, it can be defined again with annotation element, but now within a series element.
Typically users need to use data value, category name and series name strings in the annotation label. This can be achieved by using message format macros (e.g. {.value}, {.label}, {.name}) and explicit channel id references.
This example shows how to use plot annotation. Every bar has a popup text that appears when mouse cursor is moved over the bar. Popup text displays some text, data value and series name.
|
| Popup text annotation using '.value' and '.name' macros. |
This example shows annotation defined with four different ways. Each color in bars represents one annotation address. Bars with red color have their annotation address and description defined with separate channels. The target, which means the window into which an address given in annotation is opened, of the annotations is common for all annotations.
|
| Combining different annotation sources. |
Paint annotation is given after color specification in color or paint attributes. For example, paint="red?href=foo.html"
With this mechanism all chart objects can contain links and annotations.
|
| Popup text displays x, y and size values and axis title has a link to Davisor home page. |