Legend in ASP.NET MVC 3D Chart Component

18 Nov 20182 minutes to read

Legend provides information about the series rendered in the 3D chart.

Position and alignment

By using the Position property, the legend can be positioned at left, right, top or bottom of the 3D chart. The legend is positioned at the bottom of the 3D chart, by default.

The custom position helps you to position the legend anywhere in the 3D chart using X and Y coordinates.

Legend reverse

The order of the legend items can be reversed by using the Reverse property. By default, legend for the first series in the collection will be placed first.

Legend alignment

The legend can be aligned at near, far or center to the 3D chart using the Alignment property.

Legend customization

To change the legend icon shape, LegendShape property in the Series can be used. By default, the legend icon shape is SeriesType.

Legend size

By default, legend takes 20% - 25% of the 3D chart’s height horizontally, when it is placed on top or bottom position and 20% - 25% of the 3D chart’s width vertically, when it is placed on left or right position. You can change this default legend size by using the Height and Width properties of the LegendSettings.

Legend item size

The size of the legend items can be customised by using the ShapeHeight and ShapeWidth properties.

Paging for legend

Paging will be enabled by default, when the legend items exceeds the legend bounds. Each legend items can be viewed by navigating between the pages using navigation buttons.

Legend text wrap

When the legend text exceeds the container, the text can be wrapped by using the TextWrap property. End user can also wrap the legend text based on the MaximumLabelWidth property.

Series selection through legend

By default, you can collapse the series visibility by clicking the legend. On the other hand, turn off the ToggleVisibility property if you must use a legend click to choose a series.

Collapsing legend item

By default, series name will be displayed as legend. To skip the legend for a particular series, you can give empty string to the series name.

Legend title

You can set title for legend using Title property in LegendSettings. The Size, Color, Opacity, FontStyle, FontWeight, FontFamily, TextAlignment, and TextOverflow of legend title can be customized by using the TitleStyle property in LegendSettings. The TitlePosition is used to set the legend position in Top, Left and Right position. The MaximumTitleWidth is used to set the width of the legend title. By default, it will be 100px.

Arrow page navigation

The page number will always be visible while using legend paging. It is now possible to disable the page number and enable page navigation with the left and right arrows. The EnablePages property needs to be set to false in order to render the arrow page navigation.

Legend item padding

The ItemPadding property can be used to adjust the space between the legend items.