OptionsScaleTitle
Namespace: Wisej.Web.Ext.ChartJS3
Assembly: Wisej.Web.Ext.ChartJS3 (4.1.0.0)
Represents the options for the title of an axis.
- C#
- VB.NET
public class OptionsScaleTitle : OptionsBase
Public Class OptionsScaleTitle
Inherits OptionsBase
Maps to the Chart.js 3 title option of a scale. Use the Title property to access it.
Example:
var title = this.chartJS31.Options.Scales.yAxes[0].Title;
title.Text = "Sales (USD)";
title.Font = new Font("Arial", 10F, FontStyle.Italic);
Constructors
OptionsScaleTitle()
Default constructor.
Example:
var title = new OptionsScaleTitle { Text = "Hours" };
this.chartJS31.Options.Scales.xAxes[0].Title = title;
this.chartJS31.Update();
OptionsScaleTitle(owner)
Constructs a new instance of the OptionsScaleTitle set.
| Name | Type | Description |
|---|---|---|
| owner | OptionsBase | The OptionsBase set of options that owns this instance. |
Example:
var yAxis = this.chartJS31.Options.Scales.yAxes[0];
var title = new OptionsScaleTitle(yAxis);
title.Text = "Visitors";
yAxis.Title = title;
this.chartJS31.Update();
Properties
Color
Color: Returns or sets the color of the axis title. (Default: Color [Empty])
Value: When not set, returns the ForeColor of the chart control.
Maps to the Chart.js 3 title.color option of the scale. Setting this property updates the chart.
Example:
var title = this.chartJS31.Options.Scales.yAxes[0].Title;
title.Text = "Errors";
title.Color = Color.Firebrick;
Display
Boolean: Returns or sets whether the axis title is displayed.
Value: Default is true. The getter returns false when Text is empty.
Maps to the Chart.js 3 title.display option of the scale. Setting this property updates the chart.
Example:
// temporarily hide the title without clearing its text.
var title = this.chartJS31.Options.Scales.yAxes[0].Title;
title.Display = !title.Display;
Font
Font: Returns or sets the font of the axis title. (Default: null)
Value: When not set, returns the Font of the chart control.
Maps to the Chart.js 3 title.font option of the scale; the client script converts the font to the Chart.js font object (size, family and style). Setting this property updates the chart.
Example:
var title = this.chartJS31.Options.Scales.xAxes[0].Title;
title.Text = "Year";
title.Font = new Font("Verdana", 11F, FontStyle.Bold);
Text
String: Returns or sets the text for the title. (i.e. "# of People" or "Response Choices"). (Default: "")
Value: Default is an empty string. Setting null stores an empty string.
Maps to the Chart.js 3 title.text option of the scale. The title is displayed only when the text is not empty. Setting this property updates the chart.
Example:
var scales = this.chartJS31.Options.Scales;
scales.xAxes[0].Title.Text = "Response Choices";
scales.yAxes[0].Title.Text = "# of People";