OptionScalesAxesX
Namespace: Wisej.Web.Ext.ChartJS
Assembly: Wisej.Web.Ext.ChartJS (4.1.0.0)
Represents the options for the scale X axes.
- C#
- VB.NET
public class OptionScalesAxesX : OptionScalesAxes
Public Class OptionScalesAxesX
Inherits 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
OptionScalesAxesX()
Default constructor.
Example:
var xAxis = new OptionScalesAxesX { Id = "x-time", Type = ScaleType.Time };
this.chartJS1.Options.Scales.xAxes = new[] { xAxis };
OptionScalesAxesX(owner)
Constructs a new instance of the OptionScalesAxesX set.
| Name | Type | Description |
|---|---|---|
| owner | OptionsBase | The OptionsBase set of options that owns this instance. |
Example:
var scales = this.chartJS1.Options.Scales;
var xAxis = new OptionScalesAxesX(scales);
xAxis.GridLines.Display = false;
Properties
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;
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;
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;