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
ownerIChartNodeparam 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
AutoDivSpacing
Automatic division spacing.
public bool AutoDivSpacing { get; set; }
Property Value
AutoDivSpacingForNumbersInTime
The major auto div spacing in ValueType 'Number' will be calculated for Time values (seconds).
public bool AutoDivSpacingForNumbersInTime { get; set; }
Property Value
AutoFormatLabels
Automatically determines number of decimals or time format.
public bool AutoFormatLabels { get; set; }
Property Value
Remarks
Effective only when AutoDivSpacing is enabled.
AxisColor
Axis line color.
public Color AxisColor { get; set; }
Property Value
AxisThickness
Thickness of the axis line.
public double AxisThickness { get; set; }
Property Value
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
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
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
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
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
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
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
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
LabelsAngle
Labels rotation angle, in degrees.
public double LabelsAngle { get; set; }
Property Value
LabelsColor
Labels color.
public Color LabelsColor { get; set; }
Property Value
LabelsFont
Labels font.
public Font LabelsFont { get; set; }
Property Value
LabelsNumberFormat
Labels number format, used when ValueType is 'Number'.
public string LabelsNumberFormat { get; set; }
Property Value
LabelsTimeFormat
Labels number format, used when ValueType is 'Time'.
public string LabelsTimeFormat { get; set; }
Property Value
LabelsVisible
Defines if labels are visible or not.
public bool LabelsVisible { get; set; }
Property Value
LogBase
Logarithmic base. Applies only when ScaleType is set to Logarithmic.
public double LogBase { get; set; }
Property Value
Remarks
Use values higher than 1.
LogLabelsType
Logarithmic axis labels special formatting type.
public LogLabelsType LogLabelsType { get; set; }
Property Value
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
MajorDiv
Major tick interval (units / division).
public double MajorDiv { get; set; }
Property Value
MajorDivCount
Major division count.
public int MajorDivCount { get; set; }
Property Value
MajorDivTickStyle
Major division ticks style.
public AxisTickStyle MajorDivTickStyle { get; set; }
Property Value
MajorGrid
Grid at major divisions.
public GridOptions MajorGrid { get; set; }
Property Value
Maximum
Maximum axis value.
public double Maximum { get; set; }
Property Value
MaximumDateTime
Maximum axis value. Use this property when axis' ValueType is DateTime.
public DateTime MaximumDateTime { get; set; }
Property Value
Minimum
Minimum axis value.
public double Minimum { get; set; }
Property Value
MinimumDateTime
Minimum axis value. Use this property when X axis' ValueType is DateTime.
public DateTime MinimumDateTime { get; set; }
Property Value
MinorDivCount
Minor division count. The count of divisions inside a major division.
public int MinorDivCount { get; set; }
Property Value
MinorDivTickStyle
Minor division ticks style.
public AxisTickStyle MinorDivTickStyle { get; set; }
Property Value
MinorGrid
Grid at minor divisions.
public GridOptions MinorGrid { get; set; }
Property Value
ScaleType
Axis scale type.
public ScaleType ScaleType { get; set; }
Property Value
ValueType
Value type: time, numeric or coordinates.
public AxisValueType ValueType { get; set; }
Property Value
Visible
Defines if axis is visible or not.
public bool Visible { get; set; }
Property Value
Methods
AxisValueToDateTime(double)
Converts axis value to DateTime. The returned value uses value origin set by DateOrigin properties.
public DateTime AxisValueToDateTime(double axisValue)
Parameters
axisValuedoubleAxis 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
rangedoubleRange.
valueFormatstringValue format.
conditionUserFriendlyScaleCalcConditionCondition.
flagsScaleMultipleFlagsFlags.
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
dateTimeDateTimeDateTime object to convert.
Returns
- double
Value in seconds.
Dispose(bool)
Clean up any resources being used.
protected override void Dispose(bool disposing)
Parameters
disposingboolTrue 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
valueAtAxisdoubleValue.
formatStringTimestringFormat string, applied when axis type is time.
formatStringValuestringFormat string, applied when axis type is number or map coordinates.
enableLog10TypeFormattingboolWhen 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
dateDateTimeDate.
SetDateTimeRange(DateTime, DateTime)
Set date time range. This effects when ValueType is DateTime.
public void SetDateTimeRange(DateTime minimum, DateTime maximum)
Parameters
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
dMaxdoubleValue 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
dMindoubleValue to set as minimum.
SetRange(double, double)
Set axis range.
public void SetRange(double minimum, double maximum)
Parameters
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
Returns
- string
Formatted string.
Events
FormatValueLabel
Event to format axis tick value to custom string.
public event AxisBase.FormatValueLabelEventHandler FormatValueLabel
Event Type
RangeChanged
Range has changed (Minimum and/or Maximum value).
public event AxisBase.RangeChangedEventHandler RangeChanged