Version

Chart Legends

This topic introduces legends and explains which type of legends are supported by Chart Series in the XamDataChart™ control. The topic is organized as follows:

Introduction

Legends help end-user identify visuals of chart series with contextual infomration releated to data plotted in the chart control. Most charts should have at least one legend in order to make it easier to understand data displayed in the chart plot area. However, it is not a requirement and the chart can render without any legends. Most legends are small so you can render them over the chart control or outside of the chart if you decided to do so.

Types of Legends

The XamDataChart control supports various types of legends, but not all legends can be used with any type of series. The following list shows the supported group of series for each legend type.

Common Properties

All chart legends inherit from the same base class and they shares common properties with each other. The following table lists these common properties.

Property Name Property Type Description

FontFamily

Determines font family for legend items.

double

Determines font size for legend items.

FontStretch

Determines font stretch for legend items.

FontStyle

Determines font style for legend items.

FontWeight

Determines font weight for legend items.

Brush

Determines foreground brush for legend items.

HorizontalAlignment

Determines horizontal alignment of legend items in the legend.

VerticalAlignment

Determines vertical alignment of legend items in the legend.

FontFamily

Determines font family for legend title.

double

Determines font size for legend title.

FontStretch

Determines font stretch for legend title.

FontStyle

Determines font style for legend title.

FontWeight

Determines font weight for legend title.

Brush

Determines foreground brush for legend title.

HorizontalAlignment

Determines horizontal alignment of legend title in the legend.

VerticalAlignment

Determines vertical alignment of legend title in the legend.

object

Determines text displyed as header of legend above legend items.

object

Determines a template for the legend, which allows styling of the legend header and legend items.

DataTemplate

Determines a template for the legend item of a given chart series.

Series.Legend

LegendBase (Legend, ItemLegend,or ScaleLegend)

Determines unique legend for a single series in chart.

XamDataChart.Legend

LegendBase (Legend, ItemLegend,or ScaleLegend)

Determines common legend for all series in chart .