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:
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.
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™.
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.
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.
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.
To hide a legend in PCScript, use the legend.hide() method.
Add a legend to an existing Image Template file using 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.
Reverse the order of the items in the legend using 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.