OptionScalesAxesY
Namespace: Wisej.Web.Ext.ChartJS3
Assembly: Wisej.Web.Ext.ChartJS3 (4.1.0.0)
Represents the options for the scale Y axes.
- C#
- VB.NET
public class OptionScalesAxesY : OptionScalesAxes
Public Class OptionScalesAxesY
Inherits OptionScalesAxes
The default Type of a y-axis is Linear.
Example:
var yAxis = new OptionScalesAxesY { Position = HeaderPosition.Right, SuggestedMin = 0 };
yAxis.Title.Text = "Units sold";
this.chartJS31.Options.Scales.yAxes = new[] { yAxis };
this.chartJS31.Update();
Constructors
OptionScalesAxesY()
Default constructor.
Example:
var yAxis = new OptionScalesAxesY();
yAxis.Title.Text = "Temperature (°C)";
this.chartJS31.Options.Scales.yAxes = new[] { yAxis };
this.chartJS31.Update();
OptionScalesAxesY(owner)
Constructs a new instance of the OptionScalesAxesY set.
| Name | Type | Description |
|---|---|---|
| owner | OptionsBase | The OptionsBase set of options that owns this instance. |
Example:
var scales = this.chartJS31.Options.Scales;
var yAxis = new OptionScalesAxesY(scales);
yAxis.Ticks.Mirror = true;
scales.yAxes = new[] { yAxis };
this.chartJS31.Update();
Properties
LabelRotation
Int32: Returns or sets the rotation of the Y Axis labels, in degrees.
Value: Default is 0.
This is a helper property: setting a value greater than 0 sets both MinRotation and MaxRotation of Ticks to the value. Any value other than 0 turns off AutoSkip; 0 turns it back on but leaves the rotation values unchanged. Chart.js 3 applies the tick rotation only to horizontal scales, so on a vertical y-axis only the AutoSkip change has an effect. Setting this property updates the chart.
Example:
// horizontal bar chart: the y-axis is the category axis.
this.chartJS31.Options.IndexAxis = "y";
this.chartJS31.Options.Scales.yAxes[0].LabelRotation = 30;
Position
HeaderPosition: Returns or sets the position of the Y axes scale. (Default: Left)
Value: One of the HeaderPosition values. Default is Left.
Maps to the Chart.js 3 position option of the scale. Use Left or Right for a y-axis. Setting this property updates the chart.
Example:
this.chartJS31.Options.Scales.yAxes[0].Position = HeaderPosition.Right;