Skip to main content

OptionScalesAxesX

Namespace: Wisej.Web.Ext.ChartJS

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

Represents the options for the scale X axes.

public class OptionScalesAxesX : OptionScalesAxes

The default Type of an x-axis is Category.

Example:

var xAxis = new OptionScalesAxesX();
xAxis.Position = HeaderPosition.Top;
xAxis.ScaleLabel.LabelString = "Product";
this.chartJS1.Options.Scales.xAxes = new[] { xAxis };

Constructors​

Instance member OptionScalesAxesX()​

Default constructor.

Initializes Type to Category.

Example:

var xAxis = new OptionScalesAxesX { Id = "x-time", Type = ScaleType.Time };
this.chartJS1.Options.Scales.xAxes = new[] { xAxis };

Instance member OptionScalesAxesX(owner)​

Constructs a new instance of the OptionScalesAxesX set.

NameTypeDescription
ownerOptionsBaseThe OptionsBase set of options that owns this instance.

Initializes Type to Category.

Example:

var scales = this.chartJS1.Options.Scales;
var xAxis = new OptionScalesAxesX(scales);
xAxis.GridLines.Display = false;

Properties​

Instance member LabelRotation​

Int32: Rotation value of the X Axis labels, in degrees.

Value: Default is 0.

Setting a value greater than 0 sets both MinRotation and MaxRotation of Ticks to the value and turns off AutoSkip, so that all labels are rotated by the same angle. Setting it to 0 turns AutoSkip back on but leaves the rotation values unchanged.

Example:

// rotate the category labels by 45 degrees.
var xAxis = ((BarOptions)this.chartJS1.Options).Scales.xAxes[0];
xAxis.LabelRotation = 45;

Instance member Position​

HeaderPosition: Position of the X axes scale. (Default: Bottom)

Value: One of the HeaderPosition values. Default is Bottom.

Maps to the Chart.js position option of the axis. Use Top or Bottom for an x-axis.

Example:

var xAxis = ((LineOptions)this.chartJS1.Options).Scales.xAxes[0];
xAxis.Position = HeaderPosition.Top;

Instance member Type​

ScaleType: Type of scale being employed. (Default: Category)

Value: One of the ScaleType values. Default is Category.

With Category the axis labels are taken from Labels.

Example:

var xAxis = ((ScatterOptions)this.chartJS1.Options).Scales.xAxes[0];
xAxis.Type = ScaleType.Linear;