Legends

Although most legend characteristics are controlled by Corda Server™ or by preferences defined in the Image Template file, some characteristics can be controlled dynamically.

This section includes the following topics:

Drilldown on a Graph Legend Item

Graph legend items can be enabled for drilldown effects. For information about drilldown effects, see Building Drilldown

Enable a legend item for drilldown using either ITXML or PCScript.

ITXML

To add to a legend item using ITXML, modify the Series property for the appropriate legend item (Series is a property of GraphData). More information about this object is available in the Corda® 7 Object Reference in Corda Builder™.

PCScript

To add drilldown to a legend item in PCScript, use the graph.ddEnable() method, as you would for graph data. The only difference is that you add the effect to category 0, which represents the legend.

Hiding a Legend

Another useful feature is the ability to hide a legend. If an Image Template file already contains a legend, but you don't want to display it in certain instances, use ITXML or PCScript to hide it.

ITXML

To hide a legend with ITXML, set the legend's Visible property to false. More information about this object is available in the Corda 7 Object Reference in Corda Builder.

PCScript

To hide a legend in PCScript, use the legend.hide() method.

Adding a Legend with ITXML

Add a legend to an existing Image Template file using ITXML:

ITXML

To add a legend to an existing Image Template file with ITXML, add a Legend property to an existing Graph object, or Map object. More information about this property is available in the Corda 7 Object Reference in Corda Builder.

Important: Make sure the legend name is unique.

Reversing Legend Order

Reverse the order of the items in the legend using ITXML.

ITXML

To reverse the order of the items in the legend with ITXML, modify the Legend property to include a ReverseOrder='True' attribute. More information about this property is available in the Corda 7 Object Reference in Corda Builder.