Table of Contents

Class AxisBase

Namespace
LightningChartLib.WinForms.Charting.Axes
Assembly
LightningChart.WinForms.Charting.NET4.dll

Base class for X- and Y-axes.

public class AxisBase : HighlightingItemBase, IChartNode, IDisposable, IHighlightingItem
Inheritance
AxisBase
Implements
Derived
Inherited Members

Constructors

AxisBase()

Constructor.

public AxisBase()

AxisBase(IChartNode)

Constructor.

protected AxisBase(IChartNode owner)

Parameters

owner IChartNode
param owner M:LightningChartLib.WinForms.Charting.Axes.AxisBase.#ctor(LightningChartLib.WinForms.Charting.IChartNode)

Properties

AutoDivSeparationPercent

Labels gap in percents of their height when AutoDivSpacing is enabled.

public double AutoDivSeparationPercent { get; set; }

Property Value

double

AutoDivSpacing

Automatic division spacing.

public bool AutoDivSpacing { get; set; }

Property Value

bool

AutoDivSpacingForNumbersInTime

The major auto div spacing in ValueType 'Number' will be calculated for Time values (seconds).

public bool AutoDivSpacingForNumbersInTime { get; set; }

Property Value

bool

AutoFormatLabels

Automatically determines number of decimals or time format.

public bool AutoFormatLabels { get; set; }

Property Value

bool

Remarks

Effective only when AutoDivSpacing is enabled.

AxisColor

Axis line color.

public Color AxisColor { get; set; }

Property Value

Color

AxisThickness

Thickness of the axis line.

public double AxisThickness { get; set; }

Property Value

double

CustomTicks

Custom axis ticks. Allows uneven major division spacing and label text setting. Note that to see the ticks you must set CustomAxisTicksEnabled property to true.

public CustomAxisTickList CustomTicks { get; set; }

Property Value

CustomAxisTickList

CustomTicksEnabled

Custom ticks on/off. Uses the ticks defined in CustomTicks property. If this is enabled, only major ticks are drawn, not minor.

public bool CustomTicksEnabled { get; set; }

Property Value

bool

DateOriginDay

Date origin day. Keep this as close as possible to your actual first date. Applies when using DateTime formatted axis.

public int DateOriginDay { get; set; }

Property Value

int

Remarks

By setting this correctly, it will improve axis labels ticks and data rendering position greatly on 32-bit applications.

DateOriginMonth

Date origin month. Keep this as close as possible to your actual first date. Applies when using DateTime formatted axis.

public int DateOriginMonth { get; set; }

Property Value

int

Remarks

By setting this correctly, it will improve axis labels ticks and data rendering position greatly on 32-bit applications.

DateOriginYear

Date origin year. Keep this as close as possible to your actual first date. Applies when using DateTime formatted axis.

public int DateOriginYear { get; set; }

Property Value

int

Remarks

By setting this correctly, it will improve axis labels ticks and data rendering position greatly on 32-bit applications.

DateTimeRange

Gets or sets the string presentation of axis range. This property effects when ValueType is DateTime.

public string DateTimeRange { get; set; }

Property Value

string

DivisionReduction

Reduce divisions when Automatic division spacing is not set, and divisions get too close to each other.

public bool DivisionReduction { get; set; }

Property Value

bool

KeepDivCountOnRangeChange

When true, keeps division count instead of division magnitude, when axis min or max is changed. When false, keeps division magnitude instead of count.

public bool KeepDivCountOnRangeChange { get; set; }

Property Value

bool

LabelsAngle

Labels rotation angle, in degrees.

public double LabelsAngle { get; set; }

Property Value

double

LabelsColor

Labels color.

public Color LabelsColor { get; set; }

Property Value

Color

LabelsFont

Labels font.

public Font LabelsFont { get; set; }

Property Value

Font

LabelsNumberFormat

Labels number format, used when ValueType is 'Number'.

public string LabelsNumberFormat { get; set; }

Property Value

string

LabelsTimeFormat

Labels number format, used when ValueType is 'Time'.

public string LabelsTimeFormat { get; set; }

Property Value

string

LabelsVisible

Defines if labels are visible or not.

public bool LabelsVisible { get; set; }

Property Value

bool

LogBase

Logarithmic base. Applies only when ScaleType is set to Logarithmic.

public double LogBase { get; set; }

Property Value

double

Remarks

Use values higher than 1.

LogLabelsType

Logarithmic axis labels special formatting type.

public LogLabelsType LogLabelsType { get; set; }

Property Value

LogLabelsType

LogZeroClamp

Values below this limit will get this limit value when logarithmic presentation is used. This is needed to handle 0 and values below that.

public double LogZeroClamp { get; set; }

Property Value

double

MajorDiv

Major tick interval (units / division).

public double MajorDiv { get; set; }

Property Value

double

MajorDivCount

Major division count.

public int MajorDivCount { get; set; }

Property Value

int

MajorDivTickStyle

Major division ticks style.

public AxisTickStyle MajorDivTickStyle { get; set; }

Property Value

AxisTickStyle

MajorGrid

Grid at major divisions.

public GridOptions MajorGrid { get; set; }

Property Value

GridOptions

Maximum

Maximum axis value.

public double Maximum { get; set; }

Property Value

double

MaximumDateTime

Maximum axis value. Use this property when axis' ValueType is DateTime.

public DateTime MaximumDateTime { get; set; }

Property Value

DateTime

Minimum

Minimum axis value.

public double Minimum { get; set; }

Property Value

double

MinimumDateTime

Minimum axis value. Use this property when X axis' ValueType is DateTime.

public DateTime MinimumDateTime { get; set; }

Property Value

DateTime

MinorDivCount

Minor division count. The count of divisions inside a major division.

public int MinorDivCount { get; set; }

Property Value

int

MinorDivTickStyle

Minor division ticks style.

public AxisTickStyle MinorDivTickStyle { get; set; }

Property Value

AxisTickStyle

MinorGrid

Grid at minor divisions.

public GridOptions MinorGrid { get; set; }

Property Value

GridOptions

ScaleType

Axis scale type.

public ScaleType ScaleType { get; set; }

Property Value

ScaleType

ValueType

Value type: time, numeric or coordinates.

public AxisValueType ValueType { get; set; }

Property Value

AxisValueType

Visible

Defines if axis is visible or not.

public bool Visible { get; set; }

Property Value

bool

Methods

AxisValueToDateTime(double)

Converts axis value to DateTime. The returned value uses value origin set by DateOrigin properties.

public DateTime AxisValueToDateTime(double axisValue)

Parameters

axisValue double

Axis value in seconds.

Returns

DateTime

DateTime object.

CalculateUserFriendlyScaleRange(double, out string, UserFriendlyScaleCalcCondition, ScaleMultipleFlags)

Calculates user friendly scale range. Fits the decimals so that they got values of 1, 2 and 5.

public static double CalculateUserFriendlyScaleRange(double range, out string valueFormat, UserFriendlyScaleCalcCondition condition, ScaleMultipleFlags flags)

Parameters

range double

Range.

valueFormat string

Value format.

condition UserFriendlyScaleCalcCondition

Condition.

flags ScaleMultipleFlags

Flags.

Returns

double

User friendly scale range.

Construct()

Initialize members.

protected virtual void Construct()

CreateLabelsFont()

Create labels font.

protected virtual void CreateLabelsFont()

CreateMajorGrid()

Create major grid.

protected virtual void CreateMajorGrid()

CreateMajorTickStyle()

Create major grid style.

protected virtual void CreateMajorTickStyle()

CreateMinorGrid()

Create minor grid.

protected virtual void CreateMinorGrid()

CreateMinorTickStyle()

Create minor grid style.

protected virtual void CreateMinorTickStyle()

DateTimeToAxisValue(DateTime)

Converts a DateTime object to value on this axis. The returned value uses value origin set by DateOrigin properties.

public double DateTimeToAxisValue(DateTime dateTime)

Parameters

dateTime DateTime

DateTime object to convert.

Returns

double

Value in seconds.

Dispose(bool)

Clean up any resources being used.

protected override void Dispose(bool disposing)

Parameters

disposing bool

True if managed resources should be disposed, otherwise false.

FormatAxisValue(double, string, string, bool)

Format axis value to string.

public string FormatAxisValue(double valueAtAxis, string formatStringTime, string formatStringValue, bool enableLog10TypeFormatting = true)

Parameters

valueAtAxis double

Value.

formatStringTime string

Format string, applied when axis type is time.

formatStringValue string

Format string, applied when axis type is number or map coordinates.

enableLog10TypeFormatting bool

When axis is typed as Log10Exponential or LogE_MultiplesOfNeper and base is accordingly, this flag will allow value to be formatted with "E" style.

Returns

string

Formatted axis value as string.

GetLabelsFormat()

Get last used label format string. "E" is for 10 base log. "e" is for Neper base log. "" is for custom label format (unknown for chart). Consider using String.Format(returned format string) to format values.

public string GetLabelsFormat()

Returns

string

Format string for labels.

InvalidateCustomTicks()

Sets new custom ticks to take effect instantly. Call this after you have added the ticks in code.

public void InvalidateCustomTicks()

SetDateOrigin(DateTime)

Set DateOriginYear, DateOriginMonth and DateOriginDay all at same time.

public void SetDateOrigin(DateTime date)

Parameters

date DateTime

Date.

SetDateTimeRange(DateTime, DateTime)

Set date time range. This effects when ValueType is DateTime.

public void SetDateTimeRange(DateTime minimum, DateTime maximum)

Parameters

minimum DateTime

Minimum.

maximum DateTime

Maximum.

SetMaximum(double)

Internal setter of the maximum property. For bindables calls the SetCurrentValue and thus affects the value changed callback, on non-bindable calls the property setter. Does not call the setter for bindables as that would cause breaking of the binding as it calls SetValue.

protected void SetMaximum(double dMax)

Parameters

dMax double

Value to set as maximum.

SetMinimum(double)

Internal setter the minimum property. For bindables calls the SetCurrentValue and thus affects the value changed callback, on non-bindable calls the property setter. Does not call the setter for bindables as that would cause breaking of the binding as it calls SetValue.

protected void SetMinimum(double dMin)

Parameters

dMin double

Value to set as minimum.

SetRange(double, double)

Set axis range.

public void SetRange(double minimum, double maximum)

Parameters

minimum double

Minimum axis value.

maximum double

Maximum axis value.

TimeString(double, string)

Converts time value to string by given format. Handles also negative values and formats having more than three second fractions.

public string TimeString(double valueAtAxis, string formatStringTime)

Parameters

valueAtAxis double

Value in seconds.

formatStringTime string

Time format string.

Returns

string

Formatted string.

Events

FormatValueLabel

Event to format axis tick value to custom string.

public event AxisBase.FormatValueLabelEventHandler FormatValueLabel

Event Type

AxisBase.FormatValueLabelEventHandler

RangeChanged

Range has changed (Minimum and/or Maximum value).

public event AxisBase.RangeChangedEventHandler RangeChanged

Event Type

AxisBase.RangeChangedEventHandler