AxisBase
Provides base functionality for Axes throughout Ultrachart. Derived types include NumericAxis, which supports any numeric value, DateTimeAxis, which supports Date values. Axes may be styled, see the tutorials for more details
Erbt von: ContentControl
Implementiert: IAxis, IAxisParams, IHitTestable, ISuspendable, IInvalidatableElement, IDrawable, INotifyPropertyChanged, IXmlSerializable
Konstruktoren
AxisBase()
Initializes a new instance of the AxisBase class.
Eigenschaften
AnimatedVisibleRange : IRange
Gets or sets the animated VisibleRange of the Axis. When this property is set, the axis animates the VisibleRange to the new value over a duration of 500ms
AutoAlignVisibleRange : bool
Gets or sets whether to auto-align the visible range to the data when it is set. Note that this property only applies to the X-Axis. The default value is False. Whenever the VisibleRange is set on the X-Axis, the Min and Max values will be aligned to data values in the XValues
AutoTicks : bool
Gets or sets value, that indicates whether calculate ticks automatically. Default is True.
AxisAlignment : AxisAlignment
Gets or sets the AxisAlignment for this Axis. Default is Right.
AxisBandsFill : Color
Gets or sets the Fill of the Axis Bands. Also see DrawMajorBands to enable this behaviour
AxisMode : AxisMode
Gets or sets the AxisMode, e.g. Linear or Logarithmic, that this Axis operates in
CurrentDatapointPixelSize : double
Gets the current data-point size in pixels
CursorTextFormatting : string
Gets or sets the Text Formatting String for Labels on this cursor
DefaultLabelProvider : ILabelProvider
Gets the default ILabelProvider instance.
DrawLabels : bool
If True, draw labels for each major tick on the Axis, else skips this step
DrawMajorBands : bool
If True, draws Major Axis Bands (a filled area between major gridlines), else skips this step
DrawMajorGridLines : bool
If True, draws Major Grid Lines, else skips this step
DrawMajorTicks : bool
If True, draws Major Tick Lines, else skips this step
DrawMinorGridLines : bool
If True, draws Minor Grid Lines, else skips this step
DrawMinorTicks : bool
If True, draws Minor Tick Lines, else skips this step
FlipCoordinates : bool
Gets or sets a flag indicating whether to flip the tick and pixel coordinate generation for this axis, causing the axis ticks to decrement and chart to be flipped in the axis direction
GridLinesPanel : IGridLinesPanel
Get the GridLinesPanel instance off the parent UltrachartSurface
GrowBy : IRange<double>
Gets or sets the GrowBy Factor. e.g. GrowBy(0.1, 0.2) will increase the axis extents by 10% (min) and 20% (max) outside of the data range
HasDefaultVisibleRange : bool
Gets whether the VisibleRange has default value
HasValidVisibleRange : bool
Gets whether the VisibleRange is valid, e.g. is not null, is not NaN and the difference between Max and Min is not zero
Id : string
Gets or sets the string Id of this axis. Used to associated IRenderableSeries and YAxisDragModifier
IsAxisFlipped : bool
Gets whether the current axis is flipped (e.g. YAxis on the bottom or top, or XAxis on the left or right)
IsCategoryAxis : bool
Gets a value indicating whether this instance is a category axis.
IsCenterAxis : bool
Gets or sets whether current Axis should placed in the center of chart or not
IsHorizontalAxis : bool
Gets whether the current axis is horizontal or not
IsLabelCullingEnabled : bool
Gets or sets a value indicating whether Label Culling is enabled (when labels overlap) on this AxisPanel instance
IsLogarithmicAxis : bool
Gets a value indicating whether this instance is a logarithmic axis.
IsPolarAxis : bool
Gets a value indicating whether this instance is a polar axis.
IsPrimaryAxis : bool
Gets or sets whether current Axis is the main one in axis collection
IsStaticAxis : bool
Gets or sets whether current Axis is a static axis
IsSuspended : bool
Gets a value indicating whether updates for the target are currently suspended
LabelProvider : ILabelProvider
Gets or sets a ILabelProvider instance, which may be used to programmatically override the formatting of text and cursor labels. For examples, see the DefaultLabelProvider and TradeChartAxisLabelProvider
MajorDelta : IComparable
Gets or sets the Major Delta
MajorGridLineStyle : Style
Gets or sets the Major Grid Line Style (TargetType Line), applied to all major gridlines drawn by this axis
MajorLineStroke : Brush
Gets or sets the Major Line Stroke for this axis
MajorTickLineStyle : Style
Gets or sets the Major Tick Line Style (TargetType Line), applied to all major ticks on this axis
MaxAutoTicks : int
Gets or sets the max ticks.
MinimalZoomConstrain : IComparable
Gets or sets the MinimalZoomConstrain of the Axis. This is used to set minimum distance between Min and Max of the VisibleRange
MinorDelta : IComparable
Gets or sets the Minor Delta
MinorGridLineStyle : Style
Gets or sets the Minor Grid Line Style (TargetType Line), applied to all minor gridlines drawn by this axis
MinorLineStroke : Brush
Gets or sets the Minoe Line Stroke for this axis
MinorsPerMajor : int
Gets or sets the number of Minor Delta ticks per Major Tick
MinorTickLineStyle : Style
Gets or sets the Minor Tick Line Style (TargetType Line), applied to all major ticks on this axis
ModifierAxisCanvas : IAnnotationCanvas
Gets the ModifierAxisCanvas, which may be used to overlay markers on the canvas
Orientation : Orientation
Gets or sets the Axis Orientation, e.g. Horizontal (XAxis) or Vertical (YAxis)
ParentSurface : IUltrachartSurface
Gets or sets the ParentSurface that this Axis is associated with
RenderSurface : IRenderSurface
Get the RenderSurface instance off the parent UltrachartSurface
Scrollbar : UltrachartScrollbar
Gets or Sets Axis ScrollBar
Services : IServiceContainer
Gets the ServiceContainer which provides access to services throughout Ultrachart. ServiceContainers are created one per UltrachartSurface instance, and shared between peripheral components such as AxisBase, BaseRenderableSeries, ChartModifierBase instances. For a full list of available services, see the remarks on ServiceContainer
StockSharp#Xaml#Charting#Visuals#Axes#IAxis#IsXAxis
Gets whether the current axis is an X-Axis or not
StockSharp#Xaml#Charting#Visuals#IDrawable#Height
Gets or sets the suggested height of the element.
Rückgabe: The height of the element, in device-independent units (1/96th inch per unit). The default value is NaN. This value must be equal to or greater than 0.0. See Remarks for upper bound information.
StockSharp#Xaml#Charting#Visuals#IDrawable#Width
Gets or sets the width of the element.
Rückgabe: The width of the element, in device-independent units (1/96th inch per unit). The default value is NaN. This value must be equal to or greater than 0.0. See Remarks for upper bound information.
StrokeThickness : double
Gets or sets the stroke thickness.
TextFormatting : string
Gets or sets the Text Formatting String for Tick Labels on this axis
TickCoordinatesProvider : ITickCoordinatesProvider
Gets or sets a ITickCoordinatesProvider instance on current axis, which is used to transform the data-values received from the TickProvider instance to the coordinates for Axis Gridlines, Ticks and Labels drawing.
TickLabelStyle : Style
Gets or sets a style for the labels on this Axis.
TickProvider : ITickProvider
Gets or sets a ITickProvider instance on current axis, which is used to compute the data-values of Axis Gridlines, Ticks and Labels.
TickTextBrush : Brush
Gets or sets the tick text brush applied to text labels
TitleFontSize : double
Gets or sets the Axis Title Font Size
TitleFontWeight : FontWeight
Gets or sets the Axis Title Font Weight
TitleStyle : Style
Gets or sets the Style of the Axis Title
VisibleRange : IRange
Gets or sets the VisibleRange of the Axis.
VisibleRangeLimit : IRange
Gets or sets the VisibleRangeLimit of the Axis. This will be used to clip the axis during ZoomExtents and AutoRange operations
VisibleRangeLimitMode : RangeClipMode
Gets or setts the VisibleRangeLimitMode of the Axis. This property defines which parts of VisibleRangeLimit will be used by axis
Methoden
AnimateVisibleRangeTo(IRange, TimeSpan)
Animates the visible range of the axis to the destination VisibleRange, over the specified Duration. Also see AnimatedVisibleRange property which has a default duration of 500ms
- to
- The end range
- duration
- The duration of the animation.
AssertDataType(Type)
Asserts the type passed in is supported by the current axis implementation
- dataType
AssertRangeType(IRange)
Asserts the IRange is of the correct type for this axis
- range
- The range to assert
CalculateDataRange() : IRange
Calculates data range of current axis
CalculateDelta()
Calcuates the delta's for use in this render pass
CalculateTicks() : TickCoordinates
Overridden by derived types, called internal to calculate MinorTicks, MajorTicks before Axis drawing
CalculateYRange(RenderPassInfo) : IRange
Gets the aligned VisibleRange of the axis, with optional ZoomToFit flag. If ZoomToFit is true, it will return the DataRange plus any GrowBy applied to the axis
- renderPassInfo
- Struct containing data for the current render pass
Rückgabe: The VisibleRange of the axis
Clear()
Clears axis labels, ticks off this axis
CoerceVisibleRange()
When overridden in derived classes, changes value of the VisibleRange according to axis requirements before it is applied
CoerceZeroRange(IRange) : IRange
Coerce if current range is zero range
- maximumRange
- Current maximum range
ConvertTickToDataValue(IComparable) : IComparable
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
DecrementSuspend()
Called by IUpdateSuspender each time a target suspender is disposed. When the final target suspender has been disposed, ResumeUpdates is called
DrawGridLine(IRenderContext2D, IPen2D, XyDirection, float)
Draws a single grid line on the RenderSurface, using the specified Style (TargetType Line), XyDirection and integer coordinate.
- renderContext
- The IRenderContext2D instance to draw to
- linePen
- The pen (TargetType IPen2D) to apply to the grid line
- direction
- The X or Y direction to draw the
- atPoint
- The integer coordinate to draw at. If direction is XDirection, the coodinate is an X-coordinate, else it is a Y-coordinate
DrawGridLines(IRenderContext2D, TickCoordinates)
Called internal to draw gridlines before Axis drawing
DrawTickLabels(AxisCanvas, TickCoordinates, float)
Draws the ticks and gridlines during a render pass
- canvas
- The canvas to draw labels on.
- tickCoords
- The tick coords containing all coordinates for ticks and gridlines.
- offset
FormatCursorText(IComparable, bool) : string
String formats text for the cursor, using the CursorTextFormatting property as a formatting string
- value
- The data value to format
- hitTest
- Cursor hit test.
Rückgabe: The string formatted data value
FormatText(IComparable, string) : string
String formats the text, using the TextFormatting property as a formatting string
- value
- The data value to format
- format
- A composite format string
Rückgabe: The string formatted data value
FormatText(IComparable) : string
String formats the text, using the TextFormatting property as a formatting string
- value
- The data value to format
Rückgabe: The string formatted data value
GetAxisOffset() : double
Returns the offset of the axis relative to the RenderSurface. Is used for cases where axes are vertically or horizontally stacked.
GetAxisParams() : AxisParams
Gets an AxisParams struct with info about the current axis setup
GetBoundsRelativeTo(IHitTestable) : Rect
Gets the bounds of the current HitTestable element relative to another HitTestable element
- relativeTo
- The relative to.
GetCoordinate(IComparable) : double
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
Rückgabe: The pixel coordinate on this Axis corresponding to the input DataValue
GetCurrentCoordinateCalculator() : ICoordinateCalculator<double>
Gets the current ICoordinateCalculator for this Axis, based on current Visible Range and axis type
GetCurrentInteractivityHelper() : IAxisInteractivityHelper
Returns the current IAxisInteractivityHelper, valid for the current render pass, which may be used to interact with the axis (Scroll, Zoom, Pan).
GetDataValue(double) : IComparable
Transforms a pixel coordinate into a data value for this axis.
- pixelCoordinate
GetDefaultNonZeroRange() : IRange
Returns an default non zero IRange, called internally by Ultrachart to reset the VisibleRange of an axis to an undefined state
GetDeltaCalculator() : IDeltaCalculator
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.
Rückgabe: An IDeltaCalculator instance
GetMajorTickIndex(double) : decimal
Returns major tick index e.g value 0 has index #0, 0 + MajorDelta - #1, 0 + 2*MajorDelta - #2 etc...
- tick
GetMaxAutoTicks() : uint
Calculates max auto ticks amount, which is >= 1
GetMaximumRange() : IRange
Gets the Maximum Range of the axis, which is equal to the DataRange including any GrowBy factor applied
GetOffsetForLabels() : double
Returns an offset for the axis
GetPointRange() : IntegerRange
Gets the integer indices of the X-Data array that are currently in range.
Rückgabe: The indices to the X-Data that are currently in range
GetSchema() : XmlSchema
Returns an XmlSchema that describes the XML representation of the object that is produced by the WriteXml method and consumed by the ReadXml method
GetSupportedTypes() : List<Type>
Returns a list of types which current axis is designed to work with
GetUndefinedRange() : IRange
Returns an undefined IRange, called internally by Ultrachart to reset the VisibleRange of an axis to an undefined state
GetWindowedYRange(IDictionary<string, IRange>) : IRange
Returns the max range only for that axis (by the data-series on it), based on "windowed" = "displayed in current viewport" uses GrowBy()
- xRanges
- Calculates the max range based on corresponding x ranges
HitTest(Point) : AxisInfo
Performs a hit test on the Axis, returning the Data Value at the specific x or y pixel coordinate. This operation is the opposite of IComparable)
- atPoint
- The pixel coordinate on this Axis corresponding to the input DataValue
Rückgabe: An AxisInfo struct containing the datavalue and formatted data value at this coordinate
HitTest(IComparable) : AxisInfo
Performs a HitTest operation on the AxisBase. The supplied is used to convert to AxisInfo struct, which contains information about the axis, as well as formatted values
- dataValue
- The data value.
Rückgabe: The AxisInfo result
InvalidateElement()
Asynchronously requests that the element redraws itself plus children. Will be ignored if the element is ISuspendable and currently IsSuspended (within a SuspendUpdates/ResumeUpdates call)
InvalidateParent(DependencyObject, DependencyPropertyChangedEventArgs)
Provides a DependencyProperty callback which invalidates the parent UltrachartSurface
- d
- e
IsPointWithinBounds(Point) : bool
Returns true if the Point is within the bounds of the current HitTestable element
- point
- The point to test
Rückgabe: true if the Point is within the bounds
IsVisibleRangeValid() : bool
Checks if the VisibleRange is valid, e.g. is not null, is not NaN, the difference between Max and Min is positive
OnApplyTemplate()
When overridden in a derived class, is invoked whenever application code or internal processes call OnApplyTemplate.
OnBeginRenderPass(RenderPassInfo, IPointSeries)
Called internally immediately before a render pass begins
OnDraw(IRenderContext2D, IRenderPassData)
Called when the instance is drawn
- renderContext
- The IRenderContext2D used for drawing
- renderPassData
- Contains arguments and parameters for this render pass
OnPropertyChanged(string)
Raises the PropertyChanged event, as part of INotifyPropertyChanged implementation
- propertyName
- Name of the property.
OnVisibleRangeChanged(VisibleRangeChangedEventArgs)
Raises the VisibleRangeChanged event
- args
- The VisibleRangeChangedEventArgs containing event data
ResumeUpdates(IUpdateSuspender)
Resumes updates on the target, intended to be called by IUpdateSuspender
Scroll(double, ClipMode, TimeSpan)
Scrolls current VisibleRange by the specified number of pixels with the specified animation duration
- pixelsToScroll
- Scroll N pixels from the current visible range
- clipMode
- Defines how scrolling behaves when you reach the edge of the Axis extents. e.g. ClipMode.ClipAtExtents prevents panning outside of the Axis, ClipMode.None allows panning outside
- duration
- The duration of animation when zooming to extents
Scroll(double, ClipMode)
Scrolls current VisibleRange by the specified number of pixels
- pixelsToScroll
- Scroll N pixels from the current visible range
- clipMode
- Defines how scrolling behaves when you reach the edge of the Axis extents. e.g. ClipMode.ClipAtExtents prevents panning outside of the Axis, ClipMode.None allows panning outside
ScrollByDataPoints(int, TimeSpan)
Translates current VisibleRange by the specified number of datapoints with the specified animation duration
- pointAmount
- Amount of points that the start visible range is scrolled by
- duration
- The duration of animation when zooming to extents
ScrollByDataPoints(int)
Translates current VisibleRange by the specified number of datapoints
- pointAmount
- Amount of data points that the start visible range is scrolled by
ScrollTo(IRange, double)
From the starting IRange, scrolls to a new range by the specified number of pixels
- startVisibleRange
- The start visible range
- pixelsToScroll
- Scroll N pixels from the start visible range
ScrollToWithLimit(IRange, double, IRange)
From the starting IRange, scrolls to a new range by the specified number of pixels, with the specified range limit
- startVisibleRange
- The start visible range
- pixelsToScroll
- Scroll N pixels from the start visible range
- rangeLimit
- The range limit.
SuspendUpdates() : IUpdateSuspender
Suspends drawing updates on the target until the returned object is disposed, when a final draw call will be issued
Rückgabe: The disposable Update Suspender
TranslatePoint(Point, IHitTestable) : Point
Translates the point relative to the other hittestable element
- point
- The point.
- relativeTo
- The relative to.
TryApplyVisibleRange(IRange, IRange) : bool
When current VisibleRange is invalid, tries to replace it by , if both ranges are invalid, throws an exception
- newRange
- The range to apply
- oldRange
- The previous VisibleRange
Rückgabe: The value, which indicates whether the VisibleRange is applied or no
ValidateAxis()
Called to check if the axis properties are valid for rendering. Will throw an exception if not
ValidateVisibleRange(IRange)
Throws appropriate exceptions if the VisibleRange has a wrong type, or VisibleRange.Min > VisibleRange.Max
Zoom(double, double, TimeSpan)
Performs zoom on current IAxis, using as a coordinate of new range start and as a coordinate of new range end
- fromCoord
- The coordinate of new range start in pixels
- toCoord
- The coordinate of new range end in pixels
- duration
- The duration of animation when zooming to extents
Zoom(double, double)
Performs zoom on current IAxis, using as a coordinate of new range start and as a coordinate of new range end
- fromCoord
- The coordinate of new range start in pixels
- toCoord
- The coordinate of new range end in pixels
Ereignisse
DataRangeChanged : EventHandler<EventArgs>
Raised when data range is changed
PropertyChanged : PropertyChangedEventHandler
Raised when properties are changed
VisibleRangeChanged : EventHandler<VisibleRangeChangedEventArgs>
Raised when the VisibleRange is changed
Felder
AnimatedVisibleRangeProperty : DependencyProperty
Defines the Animated VisibleRange DependencyProperty
AutoAlignVisibleRangeProperty : DependencyProperty
Defines the AutoAlignVisibleRange DependencyProperty
AutoRangeProperty : DependencyProperty
Defines the AutoRange DependencyProperty
AutoTicksProperty : DependencyProperty
Defines the AutoTicks DependencyProperty
AxisAlignmentProperty : DependencyProperty
Defines the AxisAlignment DependencyProperty
AxisBandsFillProperty : DependencyProperty
Defines the AxisBandsFill DependencyProperty
AxisModeProperty : DependencyProperty
Defines the AxisMode DependencyProperty
AxisTitleProperty : DependencyProperty
Defines the AxisTitle DependencyProperty
CursorTextFormattingProperty : DependencyProperty
Defines the CursorTextFormatting DependencyProperty
DefaultAxisId : string
The Default Axis Id for new Axes
DefaultLabelProviderProperty : DependencyProperty
Defines the DefaultFormatter DependencyProperty
DrawLabelsProperty : DependencyProperty
Defines the DrawLabels DependencyProperty
DrawMajorBandsProperty : DependencyProperty
Defines the DrawMajorBands DependencyProperty
DrawMajorGridLinesProperty : DependencyProperty
Defines the DrawMajorGridLines DependencyProperty
DrawMajorTicksProperty : DependencyProperty
Defines the DrawMajorTicks DependencyProperty
DrawMinorGridLinesProperty : DependencyProperty
Defines the DrawMinorGridLines DependencyProperty
DrawMinorTicksProperty : DependencyProperty
Defines the DrawMinorTicks DependencyProperty
FlipCoordinatesProperty : DependencyProperty
Defines the FlipCoordinates DependencyProperty
GrowByProperty : DependencyProperty
Defines the GrowBy DependencyProperty
IdProperty : DependencyProperty
Defines the Id DependencyProperty
IsCenterAxisProperty : DependencyProperty
Defines the IsCenterAxis DependencyProperty
IsLabelCullingEnabledProperty : DependencyProperty
The IsLabelCullingEnabled DependencyProperty
IsPrimaryAxisProperty : DependencyProperty
Defines the IsPrimaryAxis DependencyProperty
IsStaticAxisProperty : DependencyProperty
Defines the IsStaticAxis DependencyProperty
LabelProviderProperty : DependencyProperty
Defines the LabelFormatter DependencyProperty
MajorDeltaProperty : DependencyProperty
Defines the MajorDelta DependencyProperty
MajorGridLineStyleProperty : DependencyProperty
Defines the MajorGridLineStyle DependencyProperty
MajorTickLineStyleProperty : DependencyProperty
Defines the MajorTickLineStyle DependencyProperty
MaxAutoTicksProperty : DependencyProperty
Defines the MaxAutoTicks DependencyProperty
MinDistanceToBounds : int
Defines the minimum distance to the edge of the chart to cull axis labels
MinimalZoomConstrainProperty : DependencyProperty
Defines the MinimalZoomConstrain DependencyProperty
MinorDeltaProperty : DependencyProperty
Defines the MinorDelta DependencyProperty
MinorGridLineStyleProperty : DependencyProperty
Defines the MinorGridLineStyle DependencyProperty
MinorsPerMajorProperty : DependencyProperty
Defines the MinorDelta DependencyProperty
MinorTickLineStyleProperty : DependencyProperty
Defines the MinorTickLineStyle DependencyProperty
OrientationProperty : DependencyProperty
Defines the Orientation DependencyProperty
ScrollbarProperty : DependencyProperty
Defines the Axis ScrollBar
StrokeThicknessProperty : DependencyProperty
Defines the StrokeThickness DependencyProperty
TextFormattingProperty : DependencyProperty
Defines the TextFormatting DependencyProperty
TickCoordinatesProviderProperty : DependencyProperty
Defines the TickCoordinatesProvider DependencyProperty
TickLabelStyleProperty : DependencyProperty
Defines the AutoTicks DependencyProperty
TickProviderProperty : DependencyProperty
Defines the TickProvider DependencyProperty
TickTextBrushProperty : DependencyProperty
Defines the TickTextBrush DependencyProperty
TitleFontSizeProperty : DependencyProperty
Defines the TitleFontWeight DependencyProperty
TitleFontWeightProperty : DependencyProperty
Defines the TitleFontWeight DependencyProperty
TitleStyleProperty : DependencyProperty
Defines the TitleStyle DependencyProperty
VisibleRangeLimitModeProperty : DependencyProperty
Defines the VisibleRangeLimitMode DependencyProperty
VisibleRangeLimitProperty : DependencyProperty
Defines the VisibleRangeLimit DependencyProperty
VisibleRangePointProperty : DependencyProperty
Defines the VisibleRangePoint DependencyProperty
VisibleRangeProperty : DependencyProperty
Defines the VisibleRange DependencyProperty
ZeroRangeGrowBy : double
Gets GrowBy Min and Max which applied to VisibleRange if VisibleRange.Min == VisibleRAnge.Max
_currentCoordinateCalculator : ICoordinateCalculator<double>
The current CoordinateCalculator for this render pass
_currentInteractivityHelper : IAxisInteractivityHelper
The current InteractivityHelper for this render pass