Skip to content
ChartForgeX
Class

ChartAxis

ChartForgeX.Core

Namespace
ChartForgeX.Core
Assembly
ChartForgeX
Modifiers
sealed
Attributes
Fluent(Copy = "Clone")

Defines renderer-neutral bounds, scale, ticks, labels, and visibility for one chart axis.

Inheritance

  • object
  • ChartAxis

Usage

Explore 180 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

Returned or exposed by 80

Accepted by parameters 100

Constructors

public ChartAxis() #

Methods

public ChartAxis AutomaticLabelAngle() #

Restores automatic label rotation for crowded matrices and the default zero angle for other axes.

Returns

ChartAxis The current axis.
public ChartAxis AutomaticTickCount() #

Restores automatic tick density, including measured horizontal numeric and time-axis spacing.

Returns

ChartAxis The current axis.
public ChartAxis AutomaticTicks() #

Clears the fixed step, explicit values and spacing bounds so the axis chooses its ticks again.

Returns

ChartAxis The current axis. Minor ticks and grid styling are kept.
public ChartAxis Bounds(double minimum, double maximum) #

Sets explicit bounds.

Parameters

minimum double required
maximum double required

Returns

ChartAxis
public ChartAxis LogarithmicScale(double logarithmBase = 10, ChartLogarithmicDomain domain = Positive) #

Selects a logarithmic scale, base and sign domain as one validated configuration.

Parameters

logarithmBase double = 10 optional
A finite base greater than one.
domain ChartForgeX.Core.ChartLogarithmicDomain = Positive optional
The positive or negative source domain.

Returns

ChartAxis The current axis. Existing bounds must belong to the selected domain; clear them before changing their sign.
public ChartAxis TickSpacing(double? minimum, double? maximum) #

Bounds the distance between adjacent automatic ticks, in drawing units. Null leaves either side automatic.

Parameters

minimum double? required
The smallest accepted spacing, or null.
maximum double? required
The largest preferred spacing, or null. Must not be smaller than minimum.

Returns

ChartAxis The current axis.
public ChartAxis TimeScale(TimeZoneInfo? timeZone = null, bool showTimeZone = false, string? label = null) #

Uses a UTC time scale displayed in timeZone (UTC when null) and optionally shows the zone designator.

Parameters

timeZone System.TimeZoneInfo? = null optional
The display time zone, or null for UTC.
showTimeZone bool = false optional
Whether the axis title shows the zone designator.
label string? = null optional
An optional designator such as CET or Europe/Warsaw.

Returns

ChartAxis The current axis.

Properties

public string Title { get; set; } #

Gets or sets the axis title. An empty title draws none.

public double? Min { get; set; } #

Gets or sets an explicit minimum. Null enables automatic bounds.

public double? Max { get; set; } #

Gets or sets an explicit maximum. Null enables automatic bounds.

public ChartScaleKind Scale { get; set; } #

Gets or sets the mathematical axis scale.

public double LogarithmBase { get; set; } #

Gets or sets the finite base greater than one used by logarithmic and symmetric logarithmic scales. Default: ten.

public ChartLogarithmicDomain LogarithmicDomain { get; set; } #

Gets or sets the explicitly accepted sign domain for a logarithmic scale. Default: positive.

public double SymmetricLogarithmThreshold { get; set; } #

Gets or sets the positive linear threshold used by symmetric logarithmic scaling.

public int TickCount { get; set; } #

Gets or sets the preferred number of generated ticks. An explicit value limits automatic fitting; the default lets measured horizontal numeric and time labels use the available room.

public bool IntegerTicks { get; set; } #

Gets or sets whether generated linear ticks use whole-number positions and steps of at least one. Explicit labels and other scales retain their own tick policy.

public ChartLabelDensity LabelDensity { get; set; } #

Gets or sets label density.

public double LabelAngle { get; set; } #

Gets or sets label rotation in degrees, or an offset from the selected relative orientation.

public ChartAxisLabelOrientation LabelOrientation { get; set; } #

Gets or sets how labels follow the axis. The default is a fixed screen orientation.

public bool Visible { get; set; } #

Gets or sets a value indicating whether the axis and its labels are visible.

public bool Reversed { get; set; } #

Gets or sets whether increasing values advance in the reverse visual direction. Bounds and source labels keep their original values.

public bool ShowLine { get; set; } #

Gets or sets a value indicating whether the axis rule is visible.

public double? RuleCrossAt { get; set; } #

Gets or sets the coordinate on the opposite primary physical axis at which this axis rule is drawn. Null retains its frame edge.

public double? CrossAt { get; set; } #

Gets or sets the opposite primary physical coordinate for the complete Cartesian axis, or null for the frame edge.

public Func<double, string>? LabelFormatter { get; set; } #
Fluent("LabelBy")

Gets or sets a formatter for generated labels.

public ChartValueFormat? ValueFormat { get; set; } #

Gets or sets the numeric display policy. Null uses the chart fallback or the scale-aware default for time axes.

public TimeZoneInfo? TimeZone { get; set; } #

Gets or sets the display time zone for ChartScaleKind.Time axes. Axis values are UTC instants; null keeps ticks and labels in UTC. A zone moves tick alignment and labels to that zone's wall-clock time.

public CultureInfo? Culture { get; set; } #
NoFluent

Gets or sets the culture for time labels on this axis, or null for invariant ISO dates (the default).

public ChartTimeSessionDomain? TimeSessions { get; set; } #
NoFluent

Gets or sets explicitly included intervals for a compressed time X axis, or null for continuous elapsed time.

public ChartTimeSpacing? TimeSpacing { get; set; } #
NoFluent

Gets or sets ordinal or calendar-band spacing, or null for continuous elapsed time.

public string? TimeZoneLabel { get; set; } #

Gets or sets the time-zone designator shown when ChartAxis.ShowTimeZone is enabled. Null uses UTC when ChartAxis.TimeZone is null, otherwise the zone identifier. Zone identifiers differ between Windows and IANA systems, so set an explicit label when output must match across platforms.

public bool ShowTimeZone { get; set; } #

Gets or sets a value indicating whether time axes append the time-zone designator to the axis title, or show it as the title when no title is set. Horizontal line charts also decorate their physical Y category title.

public List<ChartAxisLabel> Labels { get; private set; } #

Gets explicit value-to-label mappings.

public double? TickStep { get; } #

Gets the fixed distance between generated ticks, or null for automatic ticks.

public ChartTimeTickInterval? TimeTickStep { get; } #

Gets the fixed calendar step of a time axis, or null for automatic calendar ticks.

public IReadOnlyList<double> TickValues { get; } #

Gets the explicit tick positions, in ascending order. Empty uses generated ticks.

public double? MinimumTickSpacing { get; } #

Gets the smallest distance in drawing units the automatic tick search accepts between adjacent ticks, or null.

public double? MaximumTickSpacing { get; } #

Gets the largest distance in drawing units the automatic tick search aims for between adjacent ticks, or null.

public int MinorTickCount { get; set; } #

Gets the number of minor ticks between adjacent major ticks. Zero, the default, draws none.

public ChartAxisGridStyle? Grid { get; set; } #

Gets or sets this axis's grid styling, or null to use the chart grid style.

Fields

public const int MaximumTickValues #

The most explicit tick values one axis accepts.

Value: 1000
public const int MaximumMinorTickCount #

The most minor ticks between two adjacent major ticks.

Value: 20

Extension Methods

public static ChartAxis CrossAt(ChartAxis chartAxis, double? value) #

Sets ChartAxis.CrossAt: Gets or sets the opposite primary physical coordinate for the complete Cartesian axis, or null for the frame edge.

Parameters

chartAxis ChartForgeX.Core.ChartAxis required
The instance.
value double? required
The value.

Returns

ChartAxis The same instance.

Examples

// C# initializer or property                                  // C# fluent
new global::ChartForgeX.Core.ChartAxis { CrossAt = value };    chartAxis.CrossAt(value);
public static ChartAxis Culture(ChartAxis chartAxis, CultureInfo? culture) #

Sets the culture for this axis's tick labels and tooltips, or null for the invariant formatting.

Parameters

chartAxis ChartForgeX.Core.ChartAxis required
The instance to configure.
culture System.Globalization.CultureInfo? required
The culture; it is stored read-only.

Returns

ChartAxis The current axis.
Grid 2 overloads
public static ChartAxis Grid(ChartAxis chartAxis, ChartAxisGridStyle? value) #

Sets ChartAxis.Grid: Gets or sets this axis's grid styling, or null to use the chart grid style.

Parameters

chartAxis ChartForgeX.Core.ChartAxis required
The instance.
value ChartForgeX.Core.ChartAxisGridStyle? required
The value.

Returns

ChartAxis The same instance.

Examples

// C# initializer or property                               // C# fluent
new global::ChartForgeX.Core.ChartAxis { Grid = value };    chartAxis.Grid(value);
public static ChartAxis Grid(ChartAxis chartAxis, Action<ChartAxisGridStyle> configure) #

Configures a copy of ChartAxis.Grid (a new one when not set) and assigns a copy of it once the callback returns, leaving the property unchanged when the callback throws: Gets or sets this axis's grid styling, or null to use the chart grid style.

Parameters

chartAxis ChartForgeX.Core.ChartAxis required
The instance.
configure System.Action<ChartForgeX.Core.ChartAxisGridStyle> required
Configures the copy.

Returns

ChartAxis The same instance.
public static ChartAxis IntegerTicks(ChartAxis chartAxis, bool value = true) #

Sets ChartAxis.IntegerTicks: Gets or sets whether generated linear ticks use whole-number positions and steps of at least one. Explicit labels and other scales retain their own tick policy.

Parameters

chartAxis ChartForgeX.Core.ChartAxis required
The instance.
value bool = true optional
The value; true when omitted.

Returns

ChartAxis The same instance.

Examples

// C# initializer or property                                       // C# fluent
new global::ChartForgeX.Core.ChartAxis { IntegerTicks = value };    chartAxis.IntegerTicks(value);
public static ChartAxis Label(ChartAxis chartAxis, ChartAxisLabel item) #

Adds an item to ChartAxis.Labels: Gets explicit value-to-label mappings.

Parameters

chartAxis ChartForgeX.Core.ChartAxis required
The instance.
item ChartForgeX.Core.ChartAxisLabel required
The item.

Returns

ChartAxis The same instance.
public static ChartAxis LabelAngle(ChartAxis chartAxis, double value) #

Sets ChartAxis.LabelAngle: Gets or sets label rotation in degrees, or an offset from the selected relative orientation.

Parameters

chartAxis ChartForgeX.Core.ChartAxis required
The instance.
value double required
The value.

Returns

ChartAxis The same instance.

Examples

// C# initializer or property                                     // C# fluent
new global::ChartForgeX.Core.ChartAxis { LabelAngle = value };    chartAxis.LabelAngle(value);
public static ChartAxis LabelBy(ChartAxis chartAxis, Func<double, string>? value) #

Sets ChartAxis.LabelFormatter: Gets or sets a formatter for generated labels.

Parameters

chartAxis ChartForgeX.Core.ChartAxis required
The instance.
value System.Func<double, string>? required
The callback.

Returns

ChartAxis The same instance.

Examples

// C# initializer or property                                         // C# fluent
new global::ChartForgeX.Core.ChartAxis { LabelFormatter = value };    chartAxis.LabelBy(value);
public static ChartAxis LabelDensity(ChartAxis chartAxis, ChartLabelDensity value) #

Sets ChartAxis.LabelDensity: Gets or sets label density.

Parameters

chartAxis ChartForgeX.Core.ChartAxis required
The instance.
value ChartForgeX.Core.ChartLabelDensity required
The value.

Returns

ChartAxis The same instance.

Examples

// C# initializer or property                                       // C# fluent
new global::ChartForgeX.Core.ChartAxis { LabelDensity = value };    chartAxis.LabelDensity(value);
public static ChartAxis LabelOrientation(ChartAxis chartAxis, ChartAxisLabelOrientation value) #

Sets ChartAxis.LabelOrientation: Gets or sets how labels follow the axis. The default is a fixed screen orientation.

Parameters

chartAxis ChartForgeX.Core.ChartAxis required
The instance.
value ChartForgeX.Core.ChartAxisLabelOrientation required
The value.

Returns

ChartAxis The same instance.

Examples

// C# initializer or property                                           // C# fluent
new global::ChartForgeX.Core.ChartAxis { LabelOrientation = value };    chartAxis.LabelOrientation(value);
public static ChartAxis Labels(ChartAxis chartAxis, IEnumerable<ChartAxisLabel> items) #

Adds items to ChartAxis.Labels: Gets explicit value-to-label mappings.

Parameters

chartAxis ChartForgeX.Core.ChartAxis required
The instance.
items System.Collections.Generic.IEnumerable<ChartForgeX.Core.ChartAxisLabel> required
The items, in order.

Returns

ChartAxis The same instance.
public static ChartAxis LogarithmBase(ChartAxis chartAxis, double value) #

Sets ChartAxis.LogarithmBase: Gets or sets the finite base greater than one used by logarithmic and symmetric logarithmic scales. Default: ten.

Parameters

chartAxis ChartForgeX.Core.ChartAxis required
The instance.
value double required
The value.

Returns

ChartAxis The same instance.

Examples

// C# initializer or property                                        // C# fluent
new global::ChartForgeX.Core.ChartAxis { LogarithmBase = value };    chartAxis.LogarithmBase(value);
public static ChartAxis LogarithmicDomain(ChartAxis chartAxis, ChartLogarithmicDomain value) #

Sets ChartAxis.LogarithmicDomain: Gets or sets the explicitly accepted sign domain for a logarithmic scale. Default: positive.

Parameters

chartAxis ChartForgeX.Core.ChartAxis required
The instance.
value ChartForgeX.Core.ChartLogarithmicDomain required
The value.

Returns

ChartAxis The same instance.

Examples

// C# initializer or property                                            // C# fluent
new global::ChartForgeX.Core.ChartAxis { LogarithmicDomain = value };    chartAxis.LogarithmicDomain(value);
public static ChartAxis Max(ChartAxis chartAxis, double? value) #

Sets ChartAxis.Max: Gets or sets an explicit maximum. Null enables automatic bounds.

Parameters

chartAxis ChartForgeX.Core.ChartAxis required
The instance.
value double? required
The value.

Returns

ChartAxis The same instance.

Examples

// C# initializer or property                              // C# fluent
new global::ChartForgeX.Core.ChartAxis { Max = value };    chartAxis.Max(value);
public static ChartAxis Min(ChartAxis chartAxis, double? value) #

Sets ChartAxis.Min: Gets or sets an explicit minimum. Null enables automatic bounds.

Parameters

chartAxis ChartForgeX.Core.ChartAxis required
The instance.
value double? required
The value.

Returns

ChartAxis The same instance.

Examples

// C# initializer or property                              // C# fluent
new global::ChartForgeX.Core.ChartAxis { Min = value };    chartAxis.Min(value);
public static ChartAxis MinorTickCount(ChartAxis chartAxis, int value) #

Sets ChartAxis.MinorTickCount: Gets the number of minor ticks between adjacent major ticks. Zero, the default, draws none.

Parameters

chartAxis ChartForgeX.Core.ChartAxis required
The instance.
value int required
The value.

Returns

ChartAxis The same instance.

Examples

// C# initializer or property                                         // C# fluent
new global::ChartForgeX.Core.ChartAxis { MinorTickCount = value };    chartAxis.MinorTickCount(value);
public static ChartAxis Reversed(ChartAxis chartAxis, bool value = true) #

Sets ChartAxis.Reversed: Gets or sets whether increasing values advance in the reverse visual direction. Bounds and source labels keep their original values.

Parameters

chartAxis ChartForgeX.Core.ChartAxis required
The instance.
value bool = true optional
The value; true when omitted.

Returns

ChartAxis The same instance.

Examples

// C# initializer or property                                   // C# fluent
new global::ChartForgeX.Core.ChartAxis { Reversed = value };    chartAxis.Reversed(value);
public static ChartAxis RuleCrossAt(ChartAxis chartAxis, double? value) #

Sets ChartAxis.RuleCrossAt: Gets or sets the coordinate on the opposite primary physical axis at which this axis rule is drawn. Null retains its frame edge.

Parameters

chartAxis ChartForgeX.Core.ChartAxis required
The instance.
value double? required
The value.

Returns

ChartAxis The same instance.

Examples

// C# initializer or property                                      // C# fluent
new global::ChartForgeX.Core.ChartAxis { RuleCrossAt = value };    chartAxis.RuleCrossAt(value);
public static ChartAxis Scale(ChartAxis chartAxis, ChartScaleKind value) #

Sets ChartAxis.Scale: Gets or sets the mathematical axis scale.

Parameters

chartAxis ChartForgeX.Core.ChartAxis required
The instance.
value ChartForgeX.Core.ChartScaleKind required
The value.

Returns

ChartAxis The same instance.

Examples

// C# initializer or property                                // C# fluent
new global::ChartForgeX.Core.ChartAxis { Scale = value };    chartAxis.Scale(value);
public static ChartAxis ShowLine(ChartAxis chartAxis, bool value = true) #

Sets ChartAxis.ShowLine: Gets or sets a value indicating whether the axis rule is visible.

Parameters

chartAxis ChartForgeX.Core.ChartAxis required
The instance.
value bool = true optional
The value; true when omitted.

Returns

ChartAxis The same instance.

Examples

// C# initializer or property                                   // C# fluent
new global::ChartForgeX.Core.ChartAxis { ShowLine = value };    chartAxis.ShowLine(value);
public static ChartAxis ShowTimeZone(ChartAxis chartAxis, bool value = true) #

Sets ChartAxis.ShowTimeZone: Gets or sets a value indicating whether time axes append the time-zone designator to the axis title, or show it as the title when no title is set. Horizontal line charts also decorate their physical Y category title.

Parameters

chartAxis ChartForgeX.Core.ChartAxis required
The instance.
value bool = true optional
The value; true when omitted.

Returns

ChartAxis The same instance.

Examples

// C# initializer or property                                       // C# fluent
new global::ChartForgeX.Core.ChartAxis { ShowTimeZone = value };    chartAxis.ShowTimeZone(value);
public static ChartAxis SymmetricLogarithmThreshold(ChartAxis chartAxis, double value) #

Sets ChartAxis.SymmetricLogarithmThreshold: Gets or sets the positive linear threshold used by symmetric logarithmic scaling.

Parameters

chartAxis ChartForgeX.Core.ChartAxis required
The instance.
value double required
The value.

Returns

ChartAxis The same instance.

Examples

// C# initializer or property                                                      // C# fluent
new global::ChartForgeX.Core.ChartAxis { SymmetricLogarithmThreshold = value };    chartAxis.SymmetricLogarithmThreshold(value);
public static ChartAxis TickCount(ChartAxis chartAxis, int value) #

Sets ChartAxis.TickCount: Gets or sets the preferred number of generated ticks. An explicit value limits automatic fitting; the default lets measured horizontal numeric and time labels use the available room.

Parameters

chartAxis ChartForgeX.Core.ChartAxis required
The instance.
value int required
The value.

Returns

ChartAxis The same instance.

Examples

// C# initializer or property                                    // C# fluent
new global::ChartForgeX.Core.ChartAxis { TickCount = value };    chartAxis.TickCount(value);
TickStep 2 overloads
public static ChartAxis TickStep(ChartAxis chartAxis, double step) #

Places generated ticks at whole multiples of a positive step in data units.

Parameters

chartAxis ChartForgeX.Core.ChartAxis required
The instance to configure.
step double required
A finite step greater than zero. On logarithmic axes, a whole number of powers.

Returns

ChartAxis The current axis. A calendar step on the same axis is replaced.
public static ChartAxis TickStep(ChartAxis chartAxis, ChartTimeTickInterval step) #

Places time-axis ticks on fixed calendar boundaries, such as every month or every six hours.

Parameters

chartAxis ChartForgeX.Core.ChartAxis required
The instance to configure.
step ChartForgeX.Core.ChartTimeTickInterval required
The calendar interval.

Returns

ChartAxis The current axis. A numeric step on the same axis is replaced.
TickValues 2 overloads
public static ChartAxis TickValues(ChartAxis chartAxis, params double[] values) #

Places ticks at exactly these values; captions still use the axis formatter.

Parameters

chartAxis ChartForgeX.Core.ChartAxis required
The instance to configure.
values double[] required
Up to ChartAxis.MaximumTickValues finite values. Duplicates are merged and order does not matter.

Returns

ChartAxis The current axis.
public static ChartAxis TickValues(ChartAxis chartAxis, IEnumerable<double> values) #

Places ticks at exactly these values; captions still use the axis formatter.

Parameters

chartAxis ChartForgeX.Core.ChartAxis required
The instance to configure.
values System.Collections.Generic.IEnumerable<double> required
Up to ChartAxis.MaximumTickValues finite values. Duplicates are merged and order does not matter.

Returns

ChartAxis The current axis.
public static ChartAxis TimeSessions(ChartAxis chartAxis, ChartTimeSessionDomain? domain) #

Selects a time scale with an explicit shared session domain; null restores continuous elapsed time.

Parameters

chartAxis ChartForgeX.Core.ChartAxis required
The instance to configure.
domain ChartForgeX.Core.ChartTimeSessionDomain? required
The immutable included intervals, or null to remove compression.

Returns

ChartAxis The current axis. Existing display zone and formatting policies are retained.
public static ChartAxis TimeSpacing(ChartAxis chartAxis, ChartTimeSpacing? spacing) #

Selects a time scale and an explicit spacing policy; null restores elapsed-time spacing.

Parameters

chartAxis ChartForgeX.Core.ChartAxis required
spacing ChartForgeX.Core.ChartTimeSpacing? required

Returns

ChartAxis
public static ChartAxis TimeZone(ChartAxis chartAxis, TimeZoneInfo? value) #

Sets ChartAxis.TimeZone: Gets or sets the display time zone for ChartScaleKind.Time axes. Axis values are UTC instants; null keeps ticks and labels in UTC. A zone moves tick alignment and labels to that zone's wall-clock time.

Parameters

chartAxis ChartForgeX.Core.ChartAxis required
The instance.
value System.TimeZoneInfo? required
The value.

Returns

ChartAxis The same instance.

Examples

// C# initializer or property                                   // C# fluent
new global::ChartForgeX.Core.ChartAxis { TimeZone = value };    chartAxis.TimeZone(value);
public static ChartAxis TimeZoneLabel(ChartAxis chartAxis, string? value) #

Sets ChartAxis.TimeZoneLabel: Gets or sets the time-zone designator shown when ChartAxis.ShowTimeZone is enabled. Null uses UTC when ChartAxis.TimeZone is null, otherwise the zone identifier. Zone identifiers differ between Windows and IANA systems, so set an explicit label when output must match across platforms.

Parameters

chartAxis ChartForgeX.Core.ChartAxis required
The instance.
value string? required
The value.

Returns

ChartAxis The same instance.

Examples

// C# initializer or property                                        // C# fluent
new global::ChartForgeX.Core.ChartAxis { TimeZoneLabel = value };    chartAxis.TimeZoneLabel(value);
public static ChartAxis Title(ChartAxis chartAxis, string value) #

Sets ChartAxis.Title: Gets or sets the axis title. An empty title draws none.

Parameters

chartAxis ChartForgeX.Core.ChartAxis required
The instance.
value string required
The value.

Returns

ChartAxis The same instance.

Examples

// C# initializer or property                                // C# fluent
new global::ChartForgeX.Core.ChartAxis { Title = value };    chartAxis.Title(value);
public static ChartAxis ValueFormat(ChartAxis chartAxis, ChartValueFormat? value) #

Sets ChartAxis.ValueFormat: Gets or sets the numeric display policy. Null uses the chart fallback or the scale-aware default for time axes.

Parameters

chartAxis ChartForgeX.Core.ChartAxis required
The instance.
value ChartForgeX.Core.ChartValueFormat? required
The value.

Returns

ChartAxis The same instance.

Examples

// C# initializer or property                                      // C# fluent
new global::ChartForgeX.Core.ChartAxis { ValueFormat = value };    chartAxis.ValueFormat(value);
public static ChartAxis Visible(ChartAxis chartAxis, bool value = true) #

Sets ChartAxis.Visible: Gets or sets a value indicating whether the axis and its labels are visible.

Parameters

chartAxis ChartForgeX.Core.ChartAxis required
The instance.
value bool = true optional
The value; true when omitted.

Returns

ChartAxis The same instance.

Examples

// C# initializer or property                                  // C# fluent
new global::ChartForgeX.Core.ChartAxis { Visible = value };    chartAxis.Visible(value);