XyChartAxis Class

An axis of an XyChart: its title, its values, and how it is drawn (Mermaid x-axis and y-axis, and the xAxis and yAxis configuration).

public sealed class XyChartAxis

Remarks

The x axis shows its XyChartAxis.Categories when it has some, the values of its XyChartAxis.Range otherwise, and numbers the values of the first series from 1 when it has neither. The y axis shows the values of its XyChartAxis.Range, or fits the values of the series, from zero when the chart has bars and with round ends; it has no categories.

Constructors

NameDescription
XyChartAxis()

XyChartAxis()

XyChartAxis.cs
public XyChartAxis()

No documentation is available.

Properties

NameDescription
CategoriesGets the categories of the x axis, in order. A category gets the values at its index in the series.
LabelColorGets or sets the color of the labels of the ticks, or null for the color of the labels of the theme. Charts has one color for the labels of both axes: the color of the x axis, else of the y axis.
LabelFontSizeGets or sets the size of the font of the labels of the ticks. The default is 14. Charts has one size for the labels of both axes: the largest of the two.
LabelPaddingGets or sets the space on each side of the labels of the ticks. The default is 5. It is written back but not drawn.
LabelRotationGets or sets the rotation of the labels of the ticks of the x axis, in degrees, clockwise, between -90 and 90. The default is 0. Only the labels below a vertical chart rotate.
LineColorGets or sets the color of the line of the axis, or null for the color of the axes of the theme. See XyChartAxis.TickColor.
LineWidthGets or sets the width of the line of the axis. The default is 2. It is written back but not drawn: Charts draws a thin line.
RangeGets or sets the values the axis goes through, or null to compute them from the series.
ShowLabelsGets or sets a value that indicates whether the labels of the ticks are drawn. The default is true. The labels of the categories are always drawn: false is written back, but hides only the labels of numbers.
ShowLineGets or sets a value that indicates whether the line of the axis is drawn. The default is true.
ShowTicksGets or sets a value that indicates whether the ticks are drawn. The default is true.
ShowTitleGets or sets a value that indicates whether the title is drawn. The default is true.
TickColorGets or sets the color of the ticks, or null for the color of the axes of the theme. Charts has one color for the lines and the ticks of both axes: the first color set among the XyChartAxis.LineColor of the x axis, of the y axis, then the XyChartAxis.TickColor of the x axis, of the y axis.
TickLengthGets or sets the length of the ticks. The default is 5.
TickWidthGets or sets the width of the ticks. The default is 2. It is written back but not drawn: Charts draws thin ticks.
TitleGets or sets the title of the axis, or null for none.
TitleColorGets or sets the color of the title, or null for the color of the texts of the theme. See XyChart.TitleColor.
TitleFontSizeGets or sets the size of the font of the title. The default is 16. See XyChart.LegendFontSize.
TitlePaddingGets or sets the space on each side of the title. The default is 5. It is written back but not drawn.

Categories

XyChartAxis.cs

Gets the categories of the x axis, in order. A category gets the values at its index in the series.

public IList<string> Categories { get; }

Property value

IList<string>

LabelColor

XyChartAxis.cs

Gets or sets the color of the labels of the ticks, or null for the color of the labels of the theme. Charts has one color for the labels of both axes: the color of the x axis, else of the y axis.

public SceneColor? LabelColor { get; set; }

Property value

SceneColor?

LabelFontSize

XyChartAxis.cs

Gets or sets the size of the font of the labels of the ticks. The default is 14. Charts has one size for the labels of both axes: the largest of the two.

public double LabelFontSize { get; set; }

Property value

double

LabelPadding

XyChartAxis.cs

Gets or sets the space on each side of the labels of the ticks. The default is 5. It is written back but not drawn.

public double LabelPadding { get; set; }

Property value

double

LabelRotation

XyChartAxis.cs

Gets or sets the rotation of the labels of the ticks of the x axis, in degrees, clockwise, between -90 and 90. The default is 0. Only the labels below a vertical chart rotate.

public double LabelRotation { get; set; }

Property value

double

Gets or sets the color of the line of the axis, or null for the color of the axes of the theme. See XyChartAxis.TickColor.

public SceneColor? LineColor { get; set; }

Property value

SceneColor?

Gets or sets the width of the line of the axis. The default is 2. It is written back but not drawn: Charts draws a thin line.

public double LineWidth { get; set; }

Property value

double

Gets or sets the values the axis goes through, or null to compute them from the series.

public XyChartAxisRange? Range { get; set; }

Property value

XyChartAxisRange?

ShowLabels

XyChartAxis.cs

Gets or sets a value that indicates whether the labels of the ticks are drawn. The default is true. The labels of the categories are always drawn: false is written back, but hides only the labels of numbers.

public bool ShowLabels { get; set; }

Property value

bool

Gets or sets a value that indicates whether the line of the axis is drawn. The default is true.

public bool ShowLine { get; set; }

Property value

bool

Gets or sets a value that indicates whether the ticks are drawn. The default is true.

public bool ShowTicks { get; set; }

Property value

bool

Gets or sets a value that indicates whether the title is drawn. The default is true.

public bool ShowTitle { get; set; }

Property value

bool

Gets or sets the color of the ticks, or null for the color of the axes of the theme. Charts has one color for the lines and the ticks of both axes: the first color set among the XyChartAxis.LineColor of the x axis, of the y axis, then the XyChartAxis.TickColor of the x axis, of the y axis.

public SceneColor? TickColor { get; set; }

Property value

SceneColor?

TickLength

XyChartAxis.cs

Gets or sets the length of the ticks. The default is 5.

public double TickLength { get; set; }

Property value

double

Gets or sets the width of the ticks. The default is 2. It is written back but not drawn: Charts draws thin ticks.

public double TickWidth { get; set; }

Property value

double

Gets or sets the title of the axis, or null for none.

public string? Title { get; set; }

Property value

string?

TitleColor

XyChartAxis.cs

Gets or sets the color of the title, or null for the color of the texts of the theme. See XyChart.TitleColor.

public SceneColor? TitleColor { get; set; }

Property value

SceneColor?

TitleFontSize

XyChartAxis.cs

Gets or sets the size of the font of the title. The default is 16. See XyChart.LegendFontSize.

public double TitleFontSize { get; set; }

Property value

double

TitlePadding

XyChartAxis.cs

Gets or sets the space on each side of the title. The default is 5. It is written back but not drawn.

public double TitlePadding { get; set; }

Property value

double