CategoryDateTimeAxis
Provides a Linear, Category DateTime Axis, capable of rendering DateTime ticks on the X-Axis of a UltrachartSurface. The CategoryDateTimeAxis is specifically used in stock-charts or financial charts, since the category-nature of the axis automatically collapses weekend gaps and overnight gaps in trading charts. Each data-point is treated as equidistant despite the X Data-value.
Inherits: AxisBase
Implements: ICategoryAxis, IAxis, IAxisParams, IHitTestable, ISuspendable, IInvalidatableElement, IDrawable
Constructors
public CategoryDateTimeAxis()
categoryDateTimeAxis = CategoryDateTimeAxis()
Initializes a new instance of the CategoryDateTimeAxis class.
Properties
public double BarTimeFrame { get; set; }
value = categoryDateTimeAxis.BarTimeFrame
categoryDateTimeAxis.BarTimeFrame = value
Gets or sets the Bar Time Frame in seconds. This is the number of seconds that each data-point represents on the CategoryDateTimeAxis and is required for proper rendering. A default value of -1 allows the CategoryDateTimeAxis to estimate the timeframe
public override double CurrentDatapointPixelSize { get; }
value = categoryDateTimeAxis.CurrentDatapointPixelSize
Gets the current data-point width, which is the width of one data-point in pixels on the category axis
public override bool IsCategoryAxis { get; }
value = categoryDateTimeAxis.IsCategoryAxis
Gets a value indicating whether this instance is category axis.
public int? MinimalZoomConstrain { get; set; }
value = categoryDateTimeAxis.MinimalZoomConstrain
categoryDateTimeAxis.MinimalZoomConstrain = value
Gets or sets the MinimalZoomConstrain of the Axis. This is used to set minimum distance between Min and Max of the VisibleRange
public string SubDayTextFormatting { get; set; }
value = categoryDateTimeAxis.SubDayTextFormatting
categoryDateTimeAxis.SubDayTextFormatting = value
Gets or sets the Text Formatting String used for Axis Tick Labels when the range of the axis is sub-day
Methods
protected override IRange CalculateDataRange()
result = categoryDateTimeAxis.CalculateDataRange()
Calculates data range of current axis
protected override void CalculateDelta()
categoryDateTimeAxis.CalculateDelta()
Calcuates the delta's for use in this render pass
public override IRange CalculateYRange(RenderPassInfo renderPassInfo)
result = categoryDateTimeAxis.CalculateYRange(renderPassInfo)
Calculates the zoom-to-fit Y-Range of the axis, accounting for the data that is in the viewport and applying any GrowBy margin
- renderPassInfo
- Struct containing data for the current render pass
Returns: The VisibleRange of the axis
protected override IComparable ConvertTickToDataValue(IComparable value)
result = categoryDateTimeAxis.ConvertTickToDataValue(value)
When overridden in a derived class, converts a tick value to a data value. For instance, this may be overridden in the CategoryDateTimeAxis to convert between indices and DateTimes
- value
public override AxisParams GetAxisParams()
result = categoryDateTimeAxis.GetAxisParams()
Gets an AxisParams struct with info about the current axis setup
public override double GetCoordinate(IComparable value)
result = categoryDateTimeAxis.GetCoordinate(value)
Given the Data Value, returns the x or y pixel coordinate at that value on the Axis. This operation is the opposite of Point)
- value
- The DataValue as input
Returns: The pixel coordinate on this Axis corresponding to the input DataValue
public override IComparable GetDataValue(double pixelCoordinate)
result = categoryDateTimeAxis.GetDataValue(pixelCoordinate)
Transforms a pixel coordinate into a data value for this axis.
- pixelCoordinate
public override IRange GetDefaultNonZeroRange()
result = categoryDateTimeAxis.GetDefaultNonZeroRange()
Returns an default non zero IRange, called internally by Ultrachart to reset the VisibleRange of an axis to an undefined state
protected override IDeltaCalculator GetDeltaCalculator()
result = categoryDateTimeAxis.GetDeltaCalculator()
Returns an instance of an IDeltaCalculator which is used to compute the data-values of MajorDelta, MinorDelta. Overridden by derived types to allow calculations specific to that axis type.
Returns: An IDeltaCalculator instance
public override IRange GetMaximumRange()
result = categoryDateTimeAxis.GetMaximumRange()
Gets the Maximum Range of the axis, which is equal to the DataRange including any GrowBy factor applied
protected override List<Type> GetSupportedTypes()
result = categoryDateTimeAxis.GetSupportedTypes()
Returns a list of types which current axis is designed to work with
public override IRange GetUndefinedRange()
result = categoryDateTimeAxis.GetUndefinedRange()
Returns an undefined IRange, called internally by Ultrachart to reset the VisibleRange of an axis to an undefined state
public override bool IsOfValidType(IRange range)
result = categoryDateTimeAxis.IsOfValidType(range)
Checks whether is of valid type for this axis
- range
public override void OnBeginRenderPass(RenderPassInfo renderPassInfo, IPointSeries firstPointSeries)
categoryDateTimeAxis.OnBeginRenderPass(renderPassInfo, firstPointSeries)
Called at the start of a render pass, passing in the root IPointSeries which will define the categories
- renderPassInfo
- firstPointSeries
- the root IPointSeries which will define the categories
public DateRange ToDateRange(IndexRange visibleRange)
result = categoryDateTimeAxis.ToDateRange(visibleRange)
Converts the CategoryDateTimeAxis's VisibleRange of type IndexRange to a DateRange of concrete date-values. Note: If either index is outside of the range of data on the axis, the date values will be inteporlated.
- visibleRange
- The input IndexRange
Returns: The DateRange with transformed dates that correspond to input indices
Fields
public static readonly DependencyProperty BarTimeFrameProperty
value = CategoryDateTimeAxis.BarTimeFrameProperty
Defines the BarTimeFrame DependencyProperty. A default value of -1 allows the CategoryDateTimeAxis to estimate the timeframe
public static readonly DependencyProperty SubDayTextFormattingProperty
value = CategoryDateTimeAxis.SubDayTextFormattingProperty
Defines the SubDayTextFormatting DependencyProperty