Skip to main content

LegendTitleOptions

Namespace: Wisej.Web.Ext.ChartJS4.Models

Assembly: Wisej.Web.Ext.ChartJS4 (4.1.0.0)

Represents the configuration of the legend title (Chart.js options.plugins.legend.title).

public class LegendTitleOptions : OptionsBase

An instance is created lazily by Title. The title is only drawn when Display is true.

Example:

var chart = new ChartJS4();
var title = chart.ChartOptions.Plugins.Legend.Title;
title.Display = true;
title.Text = "Regions";
title.Color = Color.Gray;

Constructors​

Instance member LegendTitleOptions()​

Initializes a new instance of LegendTitleOptions.

Properties​

Instance member Color​

Object: Returns or sets the color of the legend title text (Chart.js color).

Value: A Color or a CSS color string. The default is null, which uses the Chart.js default font color.

Example:

var chart = new ChartJS4();
chart.ChartOptions.Plugins.Legend.Title.Color = "#666666";

Instance member Display​

Boolean: Returns or sets whether the legend title is displayed (Chart.js display). (Default: False)

Value: true to display the legend title; otherwise false. The default is false.

Example:

var chart = new ChartJS4();
chart.ChartOptions.Plugins.Legend.Title.Display = true;
chart.ChartOptions.Plugins.Legend.Title.Text = "Regions";

Instance member Padding​

Int32: Returns or sets the padding, in pixels, around the legend title (Chart.js padding). (Default: 0)

Value: The padding in pixels. The default is 0, which is not serialized, so Chart.js uses its default.

Example:

var chart = new ChartJS4();
chart.ChartOptions.Plugins.Legend.Title.Padding = 8;

Instance member Position​

String: Returns or sets the position of the legend title (Chart.js position).

Value: One of "start" | "center" | "end". The default is null, in which case Chart.js uses "center".

Example:

var chart = new ChartJS4();
chart.ChartOptions.Plugins.Legend.Title.Position = "start";

Instance member Text​

String: Returns or sets the legend title text (Chart.js text).

Value: The title text, or null (the default) for no text.

Example:

var chart = new ChartJS4();
chart.ChartOptions.Plugins.Legend.Title.Display = true;
chart.ChartOptions.Plugins.Legend.Title.Text = "Sales by region";