By default, the graph automatically calculates the best layout for the legend, based on the data that the graph displays. When automatic layout is disabled, you can set a number of properties on the legend components to customize the appearance of the legend.
The following properties of the LegendArea
component control the
display of the legend.
LegendArea Property |
Description |
---|---|
|
The color of the border around the legend area. Automatic layout respects this property value. |
|
Whether the border around the legend area is transparent (that is, does not show). Automatic layout respects this property value. |
|
The background color of the legend area. Automatic layout respects this property value. |
|
Whether the legend area background is transparent. Automatic layout respects this property value. |
|
The special effects object that defines any special effects, such as a texture or an image, for the legend area background. Automatic layout respects this property value. |
|
The position of the legend area in the graph (top, bottom, right, or left). Automatic layout respects this property value. |
AutomaticPlacement |
Whether the legend position is determined by automatic layout or by the
|
AlongGraphEdge |
Whether the legend extends along the entire edge of the graph or not.
The edge is determined by the Position property. Automatic
layout respects this property value. When this property is true ,
you should use automatic layout. |
|
The size and location of the legend area, using the |
|
Whether the graph automatically determines the number of rows of legend markers that appear in the legend, based on the number of series and the size of the legend area, or whether you set the number of rows explicitly. Automatic layout ignores this property. |
|
The number of legend markers in a row in the legend area. |
|
The orientation of the legend area, either vertical or horizontal. Automatic
layout ignores this property; |
|
The location of the legend text with regard to the legend markers, to
the left of the marker, to the right of the marker, above, or below the
marker. Automatic layout ignores this setting; |
|
Whether the legend appears in the graph at all. Automatic layout honors this property. |
The following properties of the graph control whether users can scroll through the legend to see markers.
Graph Property |
Description |
---|---|
|
Whether a scrollbar appears in the legend. Automatic layout ignores this
property; doAutoLayout sets it to SP_NEVER . |
|
The number of markers that appear in a legend at a time. Automatic layout
ignores this property; |
|
The first series for which to display a marker in the legend. Automatic
layout ignores this property; doAutoLayout sets it to 0. |
You can also limit the size of a legend marker by setting the MaxSize
property of the LegendMarker
. Automatic layout ignores the MaxSize
property; doAutoLayout
sets it to 11 pixels.
Making the Graph
Legend Scrollable
Managing Automatic
Graph Layout
Setting Rows of Legend
Markers
Setting the Location
of Legend Text
Setting the Position of a
Legend