Legend

Legend is used as a reference for each DataSeries or DataPoint. Legend can be created either for individual DataPoints or for a DataSeries. Please refer to the figure below, Legend is marked in red:

 

legend.jpg

 

<vc:Chart ... >

 

<vc:Chart.Legends>

<vc:Legend .../>

 </vc:Chart.Legends>

 

</vc:Chart>

 

If there are multiple Legends inside a Chart, then each Legend must be given a unique name which can be assigned to respective DataSeries Legend property.

 

List of attributes:

 

Attribute

Function

BorderColor

Sets color of the border line.

BorderThickness

Sets the thickness of the border line.

Background

Sets the background color of the Legend.

CornerRadius

Sets the parameter used to create rounded or elliptical corners for the element.

Cursor

This attribute sets the pointer that displays when the user moves the mouse over an element.

DockInsidePlotArea

If True then legend is placed inside the plotting region. Otherwise outside.

Enabled

Enables or disables the Legend. By default this is true.

EntryMargin

Sets the gap between legend and other elements.

FontColor

Sets color of the text in legend.

FontFamily

Sets the font of the text inside legend.

FontSize

Sets the font size of the text in legend.

FontStyle

Sets the font style of the text in legend. Takes values like "Italic" or "Normal"

FontWeight

Sets the style for the text. Takes values like "Bold", "Normal", "Black" ...

HorizontalAlignment

Sets the horizontal positioning of the legend. Takes values like "Left", "Center", "Right" and Stretch.

Href

Sets the hyper link (http:// is required).

HrefTarget

Sets where the URL specified in Href to be opened.

LabelMargin

Sets the gap between each entry in legend.

LightingEnabled

Enables or disables lighting effect for the legend.

MarkerSize

Sets the size of the marker in legend.

MaxHeight

Sets the maximum height of a Legend.

MaxWidth

Sets the maximum width of a Legend.

Opacity

Opacity can be used to make any element transparent or opaque.

Padding

Sets the gap to be left between various elements inside Legend.

Reversed

Gets or Sets whether the entries inside the Legend should be reversed or not.

ShadowEnabled

Applies a shadow to the element.

Title

Sets the text for the title of the Legend.

TitleAlignmentX

Sets the horizontal positioning of the title of the Legend.

TitleBackground

Sets the background color for the title.

TitleFontColor

Sets the color for the title text.

TitleFontFamily

Sets the font for the title text.

TitleFontSize

Sets the font size for title text.

TitleFontStyle

Sets the style for the text in title. Takes values like "Italic" or "Normal".

TitleFontWeight

Sets text styles like "Bold", "Normal", "Black" ...

ToolTipText

Sets the tool tip text content for the legend.

VerticalAlignment

Sets the vertical positioning of the legend. Takes values like "Top", "Center", "Bottom" and Stretch.

 

Remarks:

  1. Legend can be enabled or disabled by setting ShowInLegend property in DataSeries.

  2. In a single-series chart, if ShowInLegend property is set to True in DataSeries, Legend will display entries from DataPoints. You can enable or disable a DataPoint to appear in Legend by setting ShowInLegend property in DataPoint.

  3. In multi-series chart, Legend display entries from DataSeries.