Charts > Using the Charts Library > Decorations Display > Displaying a Legend
 
Displaying a Legend
The base class used to define a legend to be added to a given chart is the IlvChartLegend class. This class inherits from the IlvShadowRectangle class. Thus, the chart legend object is a graphic object just like the chart object and is positioned independently of the chart object.
Figure 10.1 shows an example of a legend that has been added to a chart. This legend is composed of three legend items and is surrounded by a filled rectangle with a shadow.
Figure 10.1    A Legend Added to a Chart
The legend items that make up the legend are represented by instances of the IlvChartLegendItem class. Each legend item is composed of two elements (see Figure 10.2):
*The graphic part illustrates the graphical representation of data with which the legend item is associated. For example, for data displayed by markers, the graphic part will show the marker with the same color and shape.
*The text part displays a description or a label for the represented data.
Figure 10.2    Elements of a Legend Item

Version 6.0
Copyright © 2015, Rogue Wave Software, Inc. All Rights Reserved.