Displaying both the Chart Legend and Chart Header

Both the Header and Legend have Compass and Location properties, and you can use one or both of these properties to change the position. The Compass property can be set to North, South, East, or West through the ComapssEnum. By default, the Header and Legend will be centered within the Compass area. The Location property can be set to a System.Drawing.Point, which accepts x and y coordinates. Both the x and y coordinates can be set to -1 to use automatic positioning.

Displaying the Header

The following example positions your chart header at the top. The point coordinates can be adjusted to fine tune the position:

      Visual Basic

      C#

Displaying the Legend

The following example will position your chart legend to the left and you cana djust the point coordinates to fine tune the position.

Note: Remember the -1 just uses the default coordinate for the Compass setting, and one or both coordinates can have absolute positions. Just make sure that the point makes sense for the position. For example you probably do not want to set a very high y value for something that has Compass set to North, because the Chart will shrink to accommodate the header.

      Visual Basic

      C#


Send us comments about this topic.
Copyright © GrapeCity, inc. All rights reserved.