Class AxisBase<T>
Defines a base functionality for 2D Axes used throughout SciChart
Namespace:
Assembly: .dll
Syntax
public abstract class AxisBase<T> extends AxisCore<T> implements IAxis, ISciChartSurfaceProvider
Type Parameters
Constructors
AxisBase(IRange<T> defaultNonZeroRange, IAxisModifierSurface axisModifierSurface)
Creates a new instance of AxisBase class
Declaration
protected AxisBase(IRange<T> defaultNonZeroRange, IAxisModifierSurface axisModifierSurface)
Parameters
Fields
DEFAULT_AXIS_ID
Declaration
public static final String DEFAULT_AXIS_ID
Field Value
DEFAULT_AXIS_TICK_LABEL_STYLE
Declaration
public static final AxisTickLabelStyle DEFAULT_AXIS_TICK_LABEL_STYLE
Field Value
autoFitMarginLabelsProperty
Declaration
protected final SmartPropertyBoolean autoFitMarginLabelsProperty
Field Value
axisLabelRotationProperty
Declaration
protected final SmartPropertyInteger axisLabelRotationProperty
Field Value
axisTickLabelStyleProperty
Declaration
protected final SmartProperty<AxisTickLabelStyle> axisTickLabelStyleProperty
Field Value
axisTitleGravityProperty
Declaration
protected final SmartPropertyInteger axisTitleGravityProperty
Field Value
axisTitleOrientationProperty
Declaration
protected final SmartProperty<AxisTitleOrientation> axisTitleOrientationProperty
Field Value
axisTitlePlacementProperty
Declaration
protected final SmartProperty<AxisTitlePlacement> axisTitlePlacementProperty
Field Value
currentCoordinateCalculator
Declaration
protected coordinateCalculators.ICoordinateCalculator currentCoordinateCalculator
Field Value
currentInteractivityHelper
Declaration
protected IAxisInteractivityHelper currentInteractivityHelper
Field Value
isLabelCullingEnabledProperty
Declaration
protected final SmartPropertyBoolean isLabelCullingEnabledProperty
Field Value
isLayoutRectDirty
Declaration
protected volatile boolean isLayoutRectDirty
Field Value
isPrimaryAxisProperty
Declaration
protected final SmartPropertyBoolean isPrimaryAxisProperty
Field Value
isProvidersDirty
Declaration
protected volatile boolean isProvidersDirty
Field Value
isRenderersDirty
Declaration
protected volatile boolean isRenderersDirty
Field Value
tickLabelStyleProperty
Declaration
protected final SmartProperty<FontStyle> tickLabelStyleProperty
Field Value
titleStyleProperty
Declaration
protected final SmartProperty<FontStyle> titleStyleProperty
Field Value
Methods
applyThemeProvider(IThemeProvider themeProvider)
Applies specified theme to current instance
Declaration
public void applyThemeProvider(IThemeProvider themeProvider)
Parameters
Overrides
attachTo(IServiceContainer services)
Declaration
public void attachTo(IServiceContainer services)
Parameters
Overrides
calculateAxisOffset()
Declaration
protected int calculateAxisOffset()
Returns
Type |
Description |
int |
Axis offset in pixels
|
calculateAxisViewportDimension()
Calculates axis viewport dimension in pixels
Declaration
protected int calculateAxisViewportDimension()
Returns
Type |
Description |
int |
Viewport dimension in pixels
|
createCoordinateCalculator(AxisParams axisParams, double visibleRangeMin, double visibleRangeMax)
Declaration
protected coordinateCalculators.ICoordinateCalculator createCoordinateCalculator(AxisParams axisParams, double visibleRangeMin, double visibleRangeMax)
Parameters
Type |
Name |
Description |
AxisParams |
axisParams |
Axis params to create calculator from
|
double |
visibleRangeMin |
The double representation of min value for visible range to create calculator from
|
double |
visibleRangeMax |
The double representation of max value for visible range to create calculator from
|
Returns
createCoordinateCalculatorFrom(IRange visibleRange)
Creates a coordinate calculator from specified visible range
Declaration
public final coordinateCalculators.ICoordinateCalculator createCoordinateCalculatorFrom(IRange visibleRange)
Parameters
Type |
Name |
Description |
IRange |
visibleRange |
|
Returns
createInteractivityHelper(coordinateCalculators.ICoordinateCalculator currentCoordinateCalculator)
Declaration
protected IAxisInteractivityHelper createInteractivityHelper(coordinateCalculators.ICoordinateCalculator currentCoordinateCalculator)
Parameters
Returns
detach()
Declaration
Overrides
getAutoFitMarginalLabels()
Gets a value indicating whether marginal labels get shifted to fit inside an axis when too long.
Declaration
public final boolean getAutoFitMarginalLabels()
Returns
getAxisAlignment()
Declaration
public final AxisAlignment getAxisAlignment()
Returns
getAxisInfoProvider()
Declaration
public IAxisInfoProvider getAxisInfoProvider()
Returns
getAxisLabelRotation()
Declaration
public Integer getAxisLabelRotation()
Returns
getAxisLayoutState()
Declaration
public final AxisLayoutState getAxisLayoutState()
Returns
getAxisModifierSurface()
Gets the axis modifier surface, which is used to place tooltips on this Axis
Declaration
public final IAxisModifierSurface getAxisModifierSurface()
Returns
getAxisOffset()
Declaration
public final int getAxisOffset()
Returns
getAxisTickLabelStyle()
Gets style for axis tick labels
Declaration
public final AxisTickLabelStyle getAxisTickLabelStyle()
Returns
getAxisTitleGravity()
Declaration
public final int getAxisTitleGravity()
Returns
getAxisTitleMarginBottom()
Gets the bottom margin of the IAxis instance in pixels.
Declaration
public final int getAxisTitleMarginBottom()
Returns
getAxisTitleMarginLeft()
Gets the left margin of the IAxis instance in pixels.
Declaration
public final int getAxisTitleMarginLeft()
Returns
getAxisTitleMarginRight()
Gets the right margin of the IAxis instance in pixels.
Declaration
public final int getAxisTitleMarginRight()
Returns
getAxisTitleMarginTop()
Gets the top margin of the IAxis instance in pixels.
Declaration
public final int getAxisTitleMarginTop()
Returns
getAxisTitleOrientation()
Gets axis title orientation
Declaration
public final AxisTitleOrientation getAxisTitleOrientation()
Returns
getAxisTitlePlacement()
Gets axis title placement
Declaration
public final AxisTitlePlacement getAxisTitlePlacement()
Returns
getAxisViewportDimension()
Declaration
public final int getAxisViewportDimension()
Returns
getBoundsRelativeTo(Rect bounds, IHitTestable hitTestable)
Declaration
public final boolean getBoundsRelativeTo(Rect bounds, IHitTestable hitTestable)
Parameters
Type |
Name |
Description |
android.graphics.Rect |
bounds |
|
IHitTestable |
hitTestable |
|
Returns
getBoundsRelativeTo(RectF bounds, IHitTestable hitTestable)
Declaration
public final boolean getBoundsRelativeTo(RectF bounds, IHitTestable hitTestable)
Parameters
Type |
Name |
Description |
android.graphics.RectF |
bounds |
|
IHitTestable |
hitTestable |
|
Returns
getContext()
Declaration
public final Context getContext()
Returns
Type |
Description |
android.content.Context |
|
getCurrentCoordinateCalculator()
Declaration
public final coordinateCalculators.ICoordinateCalculator getCurrentCoordinateCalculator()
Returns
getCurrentInteractivityHelper()
Declaration
public final IAxisInteractivityHelper getCurrentInteractivityHelper()
Returns
getDataRange(boolean forceCacheUpdate)
Gets the data range(full extents of the data) of the Axis
Declaration
public IRange<T> getDataRange(boolean forceCacheUpdate)
Parameters
Type |
Name |
Description |
boolean |
forceCacheUpdate |
|
Returns
Overrides
getFixedSize()
Declaration
public Integer getFixedSize()
Returns
getIsAxisFlipped()
Gets whether this axis is flipped (e.g YAxis on the bottom or top, or XAxis on the left or right)
Declaration
public final boolean getIsAxisFlipped()
Returns
getIsLabelCullingEnabled()
Gets a value indicating whether Label Culling is enabled (when labels overlap) on this axis instance
Declaration
public final boolean getIsLabelCullingEnabled()
Returns
getIsPrimaryAxis()
Gets whether current Axis is the main one in axis collection.
Declaration
public final boolean getIsPrimaryAxis()
Returns
getLayoutHeight()
Get height of layout placement rect
Declaration
public final int getLayoutHeight()
Returns
getLayoutRect()
Gets Rect with layout placement
Declaration
public final Rect getLayoutRect()
Returns
Type |
Description |
android.graphics.Rect |
|
getLayoutWidth()
Get width of layout placement rect
Declaration
public final int getLayoutWidth()
Returns
getMaximumRange(boolean forceCacheUpdate)
Gets the maximum range of the axis, based on the data-range of all series
Declaration
public final IRange<T> getMaximumRange(boolean forceCacheUpdate)
Parameters
Type |
Name |
Description |
boolean |
forceCacheUpdate |
|
Returns
Overrides
getOrientation()
Gets the Axis Orientation, e.g. Horizontal (XAxis) or Vertical (YAxis)
Declaration
public final int getOrientation()
Returns
getParentSurface()
Gets the parent surface that this instance is associated with
Declaration
public final ISciChartSurface getParentSurface()
Returns
getTickLabelStyle()
Gets the style which is used to draw all tick labels on this axis
Declaration
public final FontStyle getTickLabelStyle()
Returns
getTitleStyle()
Gets the style which is used to draw axis title
Declaration
public final FontStyle getTitleStyle()
Returns
getView()
Declaration
public final View getView()
Returns
Type |
Description |
android.view.View |
|
getWindowedYRange(Map<String,coordinateCalculators.ICoordinateCalculator> xCoordCalcs)
Called by the SciChartSurface internally. Returns the max range only for that axis (by the data-series on it), based on xRanges
"windowed" = "displayed in current viewport"
Note:uses GrowBy()
Declaration
public final IRange<T> getWindowedYRange(Map<String,coordinateCalculators.ICoordinateCalculator> xCoordCalcs)
Parameters
Returns
hitTest(Comparable value)
Perform a HitTest on this Axis at specified data point
Declaration
public AxisInfo hitTest(Comparable value)
Parameters
Returns
invalidateElement(boolean isAxisDirty)
Declaration
public void invalidateElement(boolean isAxisDirty)
Parameters
Type |
Name |
Description |
boolean |
isAxisDirty |
|
Overrides
isCategoryAxis()
Declaration
public boolean isCategoryAxis()
Returns
Type |
Description |
boolean |
True if this instance is category axis
|
isCenterAxis()
Gets whether current Axis should placed in the center of chart or not
Declaration
public final boolean isCenterAxis()
Returns
isHorizontalAxis()
Gets whether this axis is horizontal or not
Declaration
public final boolean isHorizontalAxis()
Returns
isPointWithinBounds(float x, float y)
Declaration
public final boolean isPointWithinBounds(float x, float y)
Parameters
Returns
isPointWithinBounds(float x, float y, IHitTestable hitTestable)
Declaration
public final boolean isPointWithinBounds(float x, float y, IHitTestable hitTestable)
Parameters
Returns
isXAxis()
Gets whether this axis is an X-Axis or not
Declaration
public final boolean isXAxis()
Returns
layoutArea(int left, int top, int right, int bottom)
Declaration
public void layoutArea(int left, int top, int right, int bottom)
Parameters
onDataRangeChanged()
Used internally for notification of axis when data range changes
Declaration
public void onDataRangeChanged()
Overrides
onDraw(IRenderContext2D renderContext, IAssetManager2D assetManager)
Declaration
public final void onDraw(IRenderContext2D renderContext, IAssetManager2D assetManager)
Parameters
onDraw(IRenderContext2D renderContext, IAssetManager2D assetManager, RenderOperationLayers drawingLayers)
Draws axis grid lines in the center of the chart
Declaration
public final void onDraw(IRenderContext2D renderContext, IAssetManager2D assetManager, RenderOperationLayers drawingLayers)
Parameters
onDrawAxis(IRenderContext2D renderContext, IAssetManager2D assetManager)
Declaration
protected void onDrawAxis(IRenderContext2D renderContext, IAssetManager2D assetManager)
Parameters
Type |
Name |
Description |
IRenderContext2D |
renderContext |
The render context instance to draw on
|
IAssetManager2D |
assetManager |
The asset manager associated with render context
|
onDrawGridLines(IRenderContext2D renderContext, IAssetManager2D assetManager, RenderOperationLayers drawingLayers)
Declaration
protected void onDrawGridLines(IRenderContext2D renderContext, IAssetManager2D assetManager, RenderOperationLayers drawingLayers)
Parameters
onIsPrimaryAxisChanged(boolean isPrimaryAxis)
Declaration
protected void onIsPrimaryAxisChanged(boolean isPrimaryAxis)
Parameters
Type |
Name |
Description |
boolean |
isPrimaryAxis |
The new IsPrimaryAxis value
|
onParentSurfaceResized(ResizedMessage resizedMessage)
Called when chart resized.
Declaration
public void onParentSurfaceResized(ResizedMessage resizedMessage)
Parameters
onRenderSurfaceChanged()
Declaration
public void onRenderSurfaceChanged()
onSizeChanged(int w, int h, int oldw, int oldh)
This method is called when axis size has changed during its layout
Declaration
protected void onSizeChanged(int w, int h, int oldw, int oldh)
Parameters
Type |
Name |
Description |
int |
w |
New width of axis in pixels
|
int |
h |
New height of axis in pixels
|
int |
oldw |
Old width of axis in pixels
|
int |
oldh |
Old height of axi in pixels
|
onUpdateMeasure()
Updates axis parts which should be updated before measure
Declaration
protected void onUpdateMeasure()
onVisibilityChanged(int visibility)
Called when visibility of axis changes
Declaration
protected void onVisibilityChanged(int visibility)
Parameters
Type |
Name |
Description |
int |
visibility |
|
Overrides
onVisibleRangeChanged(IRange oldRange, IRange newRange, boolean isAnimating)
Called when VisibleRange changes
Declaration
protected void onVisibleRangeChanged(IRange oldRange, IRange newRange, boolean isAnimating)
Parameters
Overrides
recreateCalculator()
Recreates coordinate calculator for current axis
Declaration
protected final void recreateCalculator()
Overrides
Scrolls current Visible Range by the specified number of pixels
Declaration
public final void scroll(float pixelsToScroll, ClipMode clipMode)
Parameters
Scrolls current Visible Range by the specified number of pixels with the specified animation duration
Declaration
public final void scroll(float pixelsToScroll, ClipMode clipMode, ClipModeTarget clipTarget)
Parameters
/**
Scrolls current Visible Range by the specified number of pixels with the specified animation duration
Declaration
public final void scroll(float pixelsToScroll, ClipMode clipMode, ClipModeTarget clipTarget, long duration)
Parameters
Scrolls current Visible Range by the specified number of pixels with the specified animation duration
Declaration
public final void scroll(float pixelsToScroll, ClipMode clipMode, long duration)
Parameters
setAutoFitMarginalLabels(boolean autoFitMarginalLabels)
Sets a value indicating whether marginal labels get shifted to fit inside an axis when too long.
Declaration
public final void setAutoFitMarginalLabels(boolean autoFitMarginalLabels)
Parameters
Type |
Name |
Description |
boolean |
autoFitMarginalLabels |
|
setAxisAlignment(AxisAlignment axisAlignment)
Declaration
public final void setAxisAlignment(AxisAlignment axisAlignment)
Parameters
setAxisInfoProvider(IAxisInfoProvider axisInfoProvider)
Declaration
public void setAxisInfoProvider(IAxisInfoProvider axisInfoProvider)
Parameters
setAxisLabelRotation(Integer axisLabelRotation)
Declaration
public void setAxisLabelRotation(Integer axisLabelRotation)
Parameters
Type |
Name |
Description |
Integer |
axisLabelRotation |
|
setAxisLayoutManager(IAxisLayoutManager axisLayoutManager)
Declaration
protected final void setAxisLayoutManager(IAxisLayoutManager axisLayoutManager)
Parameters
setAxisRenderer(IAxisRenderer axisRenderer)
Sets IAxisRenderer instance which will be used for rendering of this axis
Declaration
public final void setAxisRenderer(IAxisRenderer axisRenderer)
Parameters
setAxisTickLabelStyle(AxisTickLabelStyle axisTickLabelStyle)
Sets style for axis tick labels
Declaration
public final void setAxisTickLabelStyle(AxisTickLabelStyle axisTickLabelStyle)
Parameters
setAxisTitleGravity(int axisTitleGravity)
Declaration
public final void setAxisTitleGravity(int axisTitleGravity)
Parameters
Type |
Name |
Description |
int |
axisTitleGravity |
|
setAxisTitleMargins(int margin)
Sets the axis title margins, in pixels
Declaration
public final void setAxisTitleMargins(int margin)
Parameters
Type |
Name |
Description |
int |
margin |
|
setAxisTitleMargins(int left, int top, int right, int bottom)
Sets the axis title margins, in pixels
Declaration
public final void setAxisTitleMargins(int left, int top, int right, int bottom)
Parameters
setAxisTitleOrientation(AxisTitleOrientation axisTitleOrientation)
Sets axis title orientation
Declaration
public final void setAxisTitleOrientation(AxisTitleOrientation axisTitleOrientation)
Parameters
setAxisTitlePlacement(AxisTitlePlacement axisTitlePlacement)
Sets axis title placement
Declaration
public final void setAxisTitlePlacement(AxisTitlePlacement axisTitlePlacement)
Parameters
setAxisTitleRenderer(IAxisTitleRenderer axisTitleRenderer)
Declaration
protected final void setAxisTitleRenderer(IAxisTitleRenderer axisTitleRenderer)
Parameters
setFixedSize(Integer fixedSize)
Declaration
public void setFixedSize(Integer fixedSize)
Parameters
Type |
Name |
Description |
Integer |
fixedSize |
|
setGridLinesRenderer(IAxisGridLinesRenderer gridLinesRenderer)
Declaration
protected final void setGridLinesRenderer(IAxisGridLinesRenderer gridLinesRenderer)
Parameters
setIsCenterAxis(boolean isCenterAxis)
Sets whether current Axis should placed in the center of chart or not
Declaration
public final void setIsCenterAxis(boolean isCenterAxis)
Parameters
Type |
Name |
Description |
boolean |
isCenterAxis |
|
setIsLabelCullingEnabled(boolean isLabelCullingEnabled)
Sets a value indicating whether Label Culling is enabled (when labels overlap) on this axis instance
Declaration
public final void setIsLabelCullingEnabled(boolean isLabelCullingEnabled)
Parameters
Type |
Name |
Description |
boolean |
isLabelCullingEnabled |
|
setIsPrimaryAxis(boolean isPrimaryAxis)
Sets whether current Axis is the main one in axis collection.
Declaration
public final void setIsPrimaryAxis(boolean isPrimaryAxis)
Parameters
Type |
Name |
Description |
boolean |
isPrimaryAxis |
|
setIsXAxis(boolean isXAxis)
Sets whether this axis is an X-Axis or not
Declaration
public final void setIsXAxis(boolean isXAxis)
Parameters
Type |
Name |
Description |
boolean |
isXAxis |
|
setMargins(int margin)
Declaration
public final void setMargins(int margin)
Parameters
Type |
Name |
Description |
int |
margin |
|
setMargins(int left, int top, int right, int bottom)
Declaration
public final void setMargins(int left, int top, int right, int bottom)
Parameters
setOrientation(int orientation)
Sets the Axis Orientation, e.g. Horizontal (XAxis) or Vertical (YAxis)
Declaration
public final void setOrientation(int orientation)
Parameters
Type |
Name |
Description |
int |
orientation |
|
setRangeCalculationHelper(rangeCalculators.IRangeCalculationHelper<T> rangeCalculationHelper)
Declaration
protected final void setRangeCalculationHelper(rangeCalculators.IRangeCalculationHelper<T> rangeCalculationHelper)
Parameters
setTickLabelStyle(FontStyle tickLabelStyle)
Sets the style which is used to draw all tick labels on this axis
Declaration
public final void setTickLabelStyle(FontStyle tickLabelStyle)
Parameters
Type |
Name |
Description |
FontStyle |
tickLabelStyle |
|
setTitleStyle(FontStyle titleStyle)
Sets the style which is used to draw axis title
Declaration
public final void setTitleStyle(FontStyle titleStyle)
Parameters
translatePoint(PointF point, IHitTestable hitTestable)
Declaration
public final boolean translatePoint(PointF point, IHitTestable hitTestable)
Parameters
Type |
Name |
Description |
android.graphics.PointF |
point |
|
IHitTestable |
hitTestable |
|
Returns
update(IAssetManager2D assetManager, RenderPassState renderPassState)
Updates the state of this IUpdatable before rendering
Declaration
public final void update(IAssetManager2D assetManager, RenderPassState renderPassState)
Parameters
updateAxisMeasurements()
Updates measurements of axis for proper layout of its content
Declaration
public final void updateAxisMeasurements()
updateAxisParams(AxisParams axisParams)
Updates axis params according to current state of axis
Declaration
protected void updateAxisParams(AxisParams axisParams)
Parameters
Type |
Name |
Description |
AxisParams |
axisParams |
Axis params to update
|
updateCore(RenderPassState renderPassState)
Performs core update of axis
Declaration
public void updateCore(RenderPassState renderPassState)
Parameters
zoom(float fromCoordinate, float toCoordinate)
Performs zoom on current Axis, using fromCoord
as a coordinate of new range start and toCoord
as a coordinate of new range end
Declaration
public final void zoom(float fromCoordinate, float toCoordinate)
Parameters
Type |
Name |
Description |
float |
fromCoordinate |
|
float |
toCoordinate |
|
zoom(float fromCoordinate, float toCoordinate, long duration)
Performs zoom on current axis, using fromCoord
as a coordinate of new range start and toCoord
as a coordinate of new range end with the specified animation duration
Declaration
public final void zoom(float fromCoordinate, float toCoordinate, long duration)
Parameters
Type |
Name |
Description |
float |
fromCoordinate |
|
float |
toCoordinate |
|
long |
duration |
|
zoomBy(double minFraction, double maxFraction)
Performs zoom on current axis, using minFraction
as a multiplier of range start and maxFraction
as a multiplier of range end
Declaration
public final void zoomBy(double minFraction, double maxFraction)
Parameters
zoomBy(double minFraction, double maxFraction, long duration)
Performs zoom on current axis, using minFraction
as a multiplier of range start and maxFraction
as a multiplier of range end with the specified animation duration
Declaration
public final void zoomBy(double minFraction, double maxFraction, long duration)
Parameters
Implements