Setting the Location of Legend Text

By default, the graph automatically lays out legend components. The automatic layout sets legend text to the right of each legend marker. If you disable automatic layout of graph components, then you can change the location of the text in relation to the markers. You can display the text below the markers, above the markers, to the left of the markers, or on the markers, as well as to the right.

Example: Setting the location of the legend text

The following code shows how to display the legend text below each legend marker.


// disable automatic layout graph.setAutoLayout(Graph.SP_NEVER); // set the position of the legend text graph.getLegendArea().setLegendTextPosition(BaseGraphComponent.LTP_BELOW);

 

Customizing Graph Legends
Managing Automatic Graph Layout