Type class
Creates a duration axis.
Click here for more info
Data item
DurationAxis uses data items of type IDurationAxisDataItem
.
Sources
DurationAxis can be used (imported) via one of the following packages.
// Import DurationAxis import * as am5xy from "@amcharts/amcharts5/xy"; // Create DurationAxis am5xy.DurationAxis.new(root, { // ... config if applicable });
<!-- Load DurationAxis --> <script src="xy.js"></script> <script> // Create DurationAxis am5xy.DurationAxis.new(root, { // ... config if applicable }); </script>
Inheritance
DurationAxis extends ValueAxis
.
DurationAxis is not extended by any other symbol.
Settings
Set these settings on a DurationAxis object using its set()
and setAll()
methods.
Read about settings concept.
active # |
Type Inherited from Indicates if element is currently active. |
---|---|
autoZoom # |
Type Default Inherited from If set to IMPORTANT: This setting will be ignored if both X and Y axes are a @since 5.2.20 |
background # |
Type Inherited from Background element. Click here for more info |
baseUnit # |
Type Default A base unit (granularity) of data. Used to indicate what are the base units of your data. Available options: Click here for more info |
baseValue # |
Type Default Inherited from Base value, which indicates the threshold between "positive" and "negative" values. Click here for more info |
blur # |
Type Inherited from Apply blur filter. Ranges of values in pixels: IMPORTANT: This setting is not supported in Safari browsers. Click here for more info |
brightness # |
Type Inherited from Modifty visual brightness. Range of values: IMPORTANT: This setting is not supported in Safari browsers. Click here for more info |
bullet # |
Type Inherited from A function that will be used to create bullets on each cell. Click here for more info |
calculateTotals # |
Type Inherited from If your series relies on dynamically calculated values, like value changes, percents, or total sums, set this to Click here for more info |
centerX # |
Type Inherited from X coordinate of the center of the element relative to itself. Center coordinates will affect placement as well as rotation pivot point. |
centerY # |
Type Inherited from Y coordinate of the center of the element relative to itself. Center coordinates will affect placement as well as rotation pivot point. |
contrast # |
Type Inherited from Modify contrast. Range of values: IMPORTANT: This setting is not supported in Safari browsers. Click here for more info |
crisp # |
Type Default Inherited from If set to It will round x/y position so it is positioned fine "on pixel". It will also adjust NOTE: this is might not universally work, especially when set on several objects that are supposed to fit perfectly with each other. @since 5.3.0 |
cursorOverStyle # |
Type Inherited from A named mouse cursor style to show when hovering this element. Click here for more info |
dateFormatter # |
Type Inherited from An instance of Click here for more info |
disabled # |
Type Inherited from Indicates if element is disabled. |
draggable # |
Type Inherited from If set to |
durationFormatter # |
Type Inherited from An instance of Click here for more info |
dx # |
Type Inherited from Horizontal shift in pixels. Can be negative to shift leftward. |
dy # |
Type Inherited from Vertical shift in pixels. Can be negative to shift upward. |
end # |
Type Inherited from The initial relative zoom end position of the axis. E.g. stting it to Click here for more info |
exportable # |
Type Inherited from If set to |
extraMax # |
Type Inherited from Relative extension to the automatically-calculated maximum value of the axis scale. E..g. Click here for more info |
extraMin # |
Type Inherited from Relative extension to the automatically-calculated minimum value of the axis scale. E..g. Click here for more info |
extraTooltipPrecision # |
Type Inherited from If set, will use greater precision for the axis tooltip than the one for axis' actual labels. E.g. if axis displays labels with one decimal ( Click here for more info |
fillRule # |
Type Inherited from A function that can be used to specify how to configure axis fills. Click here for more info |
fixAxisSize # |
Type Default Inherited from If set to |
forceHidden # |
Type Inherited from If set to |
forceInactive # |
Type Inherited from If set to @since 5.0.21 |
height # |
Type Inherited from Element's absolute height in pixels (numeric value) or relative height to parent ( |
html # |
Type Inherited from HTML content of the container. Click here for more info |
hue # |
Type Inherited from Rotate HUE colors in degrees. Range of values: IMPORTANT: This setting is not supported in Safari browsers. Click here for more info |
id # |
Type Inherited from A custom string ID for the element. If set, element can be looked up via Will raise error if an element with the same ID already exists. |
interactive # |
Type Inherited from Should this element accept user interaction events? |
interactiveChildren # |
Type Inherited from If set to |
interpolationDuration # |
Type Inherited from A duration of the animation from one setting value to another, in milliseconds. Click here for more info |
interpolationEasing # |
Type Inherited from Easing function to use for cross setting value animations. Click here for more info |
invert # |
Type Inherited from Invert colors. Range of values: IMPORTANT: This setting is not supported in Safari browsers. Click here for more info |
isMeasured # |
Type Inherited from If set to |
layer # |
Type Inherited from Numeric layer to put element in. Elements with higher number will appear in front of the ones with lower numer. If not set, will inherit layer from its ascendants. |
layerMargin # |
Type Inherited from Margins for the layer. Can be used to make the layer larger/or smaller than default chart size. @since @5.2.39 |
layout # |
Type Inherited from A method to layout Click here for more info |
logarithmic # |
Type Inherited from If set to Click here for more info |
marginBottom # |
Type Inherited from Bottom margin in pixels. |
marginLeft # |
Type Inherited from Left margin in pixels. |
marginRight # |
Type Inherited from Right margin in pixels. |
marginTop # |
Type Inherited from Top margin in pixels. |
mask # |
Type Inherited from An element to use as a container's mask (clipping region). Click here for more info |
maskContent # |
Type Inherited from If set to |
max # |
Type Inherited from Override maximum value for the axis scale. NOTE: the axis might modify the maximum value to fit into its scale better, unless Click here for more info |
maxDeviation # |
Type Default Inherited from A relative distance the axis is allowed to be zoomed/panned beyond its actual scope. Click here for more info |
maxHeight # |
Type Inherited from Maximum allowed height in pixels. |
maxPrecision # |
Type Inherited from Maximum number of decimals to allow in axis labels. This setting not only affects formatting of the labels, but also where and how many grid/labels are placed on the axis. Click here for more info |
maxWidth # |
Type Inherited from Maximum allowed width in pixels. |
maxZoomCount # |
Type Inherited from Maximum number of axis elements to show at a time. E.g. for a For a The axis will not allow to be zoomed out beyond this number. Click here for more info |
maxZoomFactor # |
Type Default Inherited from Maximum number of times the scope of the axis could auto-zoom-in. This is to prevent axis jumping too drastically when scrolling/zooming. |
min # |
Type Inherited from Override minimum value for the axis scale. NOTE: the axis might modify the minimum value to fit into its scale better, unless Click here for more info |
minHeight # |
Type Inherited from Minimum allowed height in pixels. |
minWidth # |
Type Inherited from Minimum allowed width in pixels. |
minZoomCount # |
Type Inherited from Minimum number of axis elements to show at a time. E.g. for a For a The axis will not allow to be zoomed in beyond this number. Click here for more info |
numberFormat # |
Type Inherited from Number format to use for axis labels. If not set, will use format set in global number formatter. Click here for more info |
numberFormatter # |
Type Inherited from An instance of Click here for more info |
opacity # |
Type Inherited from Opacity. 0 - fully transparent; 1 - fully opaque. |
paddingBottom # |
Type Inherited from Bottom padding in pixels. |
paddingLeft # |
Type Inherited from Left padding in pixels. |
paddingRight # |
Type Inherited from Right padding in pixels. |
paddingTop # |
Type Inherited from Top padding in pixels. |
panX # |
Type Inherited from If set to Click here for more info |
panY # |
Type Inherited from If set to Click here for more info |
position # |
Type Inherited from Positioning of the element. |
renderer # |
Type Inherited from A renderer object which is responsible of rendering visible axis elements. Click here for more info |
reverseChildren # |
Type Inherited from If set to @since 5.1.1 |
rotation # |
Type Inherited from Rotation in degrees. |
saturate # |
Type Inherited from Modify saturation. Range of values in pixels:
Click here for more info |
scale # |
Type Inherited from Scale. Setting to a value less than 1 will shrink object. |
sepia # |
Type Inherited from Apply sepia filter. Range of values: IMPORTANT: This setting is not supported in Safari browsers. Click here for more info |
setStateOnChildren # |
Type Inherited from If set to Click here for more info |
showTooltipOn # |
Type Default Inherited from Defines when tooltip is shown over the element. Available options:
Click here for more info |
snapTooltip # |
Type Default Inherited from Should tooltip snap to the |
start # |
Type Inherited from The initial relative zoom start position of the axis. E.g. stting it to Click here for more info |
stateAnimationDuration # |
Type Inherited from Duration of transition from one state to another. |
stateAnimationEasing # |
Type Inherited from Easing of transition from one state to another. |
strictMinMax # |
Type Inherited from Force axis scale to be precisely at values as set in In case This effectively locks the axis from auto-zooming itself when chart is zoomed in. If you need to zoom to actual low/high values within currently visible scope, use Use Click here for more info |
strictMinMaxSelection # |
Type Inherited from Force axis to auto-zoom to exact lowest and highest values from attached series' data items within currently visible range. This is a good feature when your series is plotted from derivative values, like This will not work if strictMinMax is set to true (the axis will not zoom at all in this case). Use @since 5.1.11 |
syncWithAxis # |
Type Inherited from This setting can be set to an instance of another If set the grid of this axis will be synced with grid of the target axis. NOTE: this is not 100% guaranteed to work. In some rare cases perfect sync might not be possible. Click here for more info |
templateField # |
Type Inherited from Allows binding element's settings to data. Click here for more info |
themeTags # |
Type Inherited from Tags which can be used by the theme rules. Click here for more info |
themeTagsSelf # |
Type Inherited from Tags which can be used by the theme rules. These tags only apply to this object, not any children. Click here for more info |
themes # |
Type Inherited from A list of themes applied to the element. |
toggleKey # |
Type Inherited from If set, element will toggle specified boolean setting between |
tooltip # |
Type Inherited from
|
tooltipHTML # |
Type Inherited from HTML content to show in a tooltip when hovered. @since 5.2.11 |
tooltipLocation # |
Type Default Inherited from
|
tooltipNumberFormat # |
Type Inherited from A numeric format used for numbers displayed in axis tooltip. Click here for more info |
tooltipPosition # |
Type Inherited from Tooltip position. |
tooltipText # |
Type Inherited from Text to show in a tooltip when hovered. |
tooltipX # |
Type Inherited from Tooltip pointer X coordinate relative to the element itself. |
tooltipY # |
Type Inherited from Tooltip pointer Y coordinate relative to the element itself. |
treatZeroAs # |
Type Inherited from Treat zero values as some other value. Useful in situations where zero would result in error, i.e. logarithmic scale. Click here for more info |
userData # |
Type Inherited from A storage for any custom user data that needs to be associated with the element. |
verticalScrollbar # |
Type Inherited from Setting this to an instance of Click here for more info |
visible # |
Type Inherited from Is element visible? |
wheelable # |
Type Inherited from If set to |
width # |
Type Inherited from Element's absolute width in pixels (numeric value) or relative width to parent ( |
x # |
Type Inherited from X position relative to parent. |
y # |
Type Inherited from Y position relative to parent. |
zoomX # |
Type Inherited from If set to Click here for more info |
zoomY # |
Type Inherited from If set to Click here for more info |
zoomable # |
Type Inherited from Set this to |
There are 108 inherited items currently hidden from this list. |
Private settings
These are read-only settings accessible from a DurationAxis object using its getPrivate()
method.
Read about private settings.
cellWidth # |
Read only
Type Inherited from Width in pixels between grid lines (read-only). It might not be exact, as Could be used to detect when size changes and to adjust labels for them not to overlap. |
---|---|
durationFormat # |
Read only
Type A format to used by axis to format its labels. @readonly |
focusable # |
Read only
Type Inherited from If set to @since 5.3.16 |
htmlElement # |
Read only
Type Inherited from A |
max # |
Read only
Type Inherited from Calculated current maximum value of the axis scale. @readonly |
maxFinal # |
Read only
Type Inherited from A maximum value of the axis scale. Can be useful in cases where axis zoom is currently being animated, and @readonly |
min # |
Read only
Type Inherited from Calculated current minimum value of the axis scale. @readonly |
minFinal # |
Read only
Type Inherited from A minimum value of the axis scale. Can be useful in cases where axis zoom is currently being animated, and @readonly |
selectionMax # |
Read only
Type Inherited from Calculated maximum value of the currently viewable (zoomed) scope. @readonly |
selectionMaxFinal # |
Read only
Type Inherited from A target maximum value of the viewable value scope. Can be useful in cases where axis zoom is currently being animated, and @readonly |
selectionMin # |
Read only
Type Inherited from Calculated minimum value of the currently viewable (zoomed) scope. @readonly |
selectionMinFinal # |
Read only
Type Inherited from A target minimum value of the viewable value scope. Can be useful in cases where axis zoom is currently being animated, and @readonly |
selectionStepFinal # |
Read only
Type Inherited from When selection step changes, it might change during axis zoom animation. @readonly |
showingTooltip # |
Read only
Type Inherited from Is element currently showing a tooltip? |
step # |
Read only
Type Inherited from Value step between grid lines. @readonly |
stepDecimalPlaces # |
Read only
Type Inherited from Decimal places used when formatting axis labels. @readonly |
tooltipPosition # |
Read only
Type Inherited from Saves position to which tooltip points. |
tooltipTarget # |
Read only
Type Inherited from An element tooltip should inherit its colors from. |
trustBounds # |
Read only
Type Inherited from If set to This helps to solve ghost tooltips problem that sometimes appear while moving the pointer over interactive objects. This is set to @since 5.5.0 |
There are 18 inherited items currently hidden from this list. |
Properties
adapters # |
Type Default Inherited from |
---|---|
axisHeader # |
Type Default Inherited from A container above the axis that can be used to add additional stuff into it. For example a legend, label, or an icon. Click here for more info |
axisRanges # |
Type Default Inherited from A list of axis ranges. Click here for more info |
bulletsContainer # |
Type Default Inherited from A |
chart # |
Type Inherited from A referenece to the the chart the axis belongs to. |
children # |
Type Default Inherited from List of Container's child elements. |
className # |
Static
Type Default |
classNames # |
Static
Type Default |
data # |
Type Inherited from Component's data. Click here for more info |
dataItem # |
Type Inherited from A NOTE: data item is being assigned automatically in most cases where it matters. Use this accessor to set data item only if you know what you're doing. |
dataItems # |
Type Inherited from A list of component's data items. |
enableDispose # |
Type Default Inherited from If this is set to |
events # |
Inherited from |
ghostLabel # |
Type Inherited from A control label that is invisible but is used to keep width the width of the axis constant. Click here for more info |
gridContainer # |
Type Default Inherited from A |
inited # |
Type Default Inherited from Indicates if the component has already been initialized. |
labelsContainer # |
Type Default Inherited from A |
minorDataItems # |
Type Default Inherited from Array of minor data items. |
parent # |
Type Inherited from Parent |
root # |
Type Inherited from An instance of @readonly |
series # |
Type Inherited from A list of series using this axis. |
states # |
Type Default Inherited from |
template # |
Type Inherited from @todo needs description |
topGridContainer # |
Type Default Inherited from A |
uid # |
Type Default Inherited from Unique ID. |
There are 23 inherited items currently hidden from this list. |
Methods
allChildren() |
Returns Inherited from |
---|---|
animate( options: ) |
Returns Inherited from Animates setting values from current/start values to new ones. Click here for more info |
appear( duration?: ) |
Returns Inherited from Plays initial reveal animation regardless if element is currently hidden or visible. |
basePosition() |
Returns Inherited from Returns relative position of axis' |
baseValue() |
Returns Inherited from Base value of the |
compositeOpacity() |
Returns Inherited from Returns an actual opacity of the element, taking into account all parents. @since 5.2.11 |
compositeRotation() |
Returns Inherited from Returns an actual roation of the element, taking into account all parents. @since 5.9.2 |
compositeScale() |
Returns Inherited from Returns an actual scale of the element, taking into account all parents. @since 5.9.2 |
coordinateToPosition( coordinate: ) |
Returns Inherited from Converts pixel coordinate to a relative position on axis. |
createAxisRange( axisDataItem: ) |
Returns Inherited from Creates and returns an axis range object. Click here for more info |
depth() |
Returns Inherited from Returns depth (how deep in the hierachy of the content tree) of this element. |
dispose() |
Returns Inherited from Disposes this object. |
eachChildren( f: ( child: ) |
Returns Inherited from |
get( key: ) |
Returns Inherited from Returns settings value for the specified If there is no value, Click here for more info |
getCellWidthPosition() |
Returns Inherited from Returns relative position between two grid lines of the axis. |
getDateFormatter() |
Returns Inherited from Returns an instance of If this element does not have it set, global one form Click here for more info |
getDurationFormatter() |
Returns Inherited from Returns an instance of If this element does not have it set, global one form Click here for more info |
getNumberFormatter() |
Returns Inherited from Returns an instance of If this element does not have it set, global one form Click here for more info |
getSeriesItem( series: ) |
Returns Inherited from Returns a data item from series that is closest to the |
getTooltip() |
Returns Inherited from Returns |
getTooltipText( position: ) |
Returns Returns text to be used in an axis tooltip for specific relative position. |
getX( value: ) |
Returns Inherited from Returns X coordinate in pixels corresponding to specific value. |
getY( value: ) |
Returns Inherited from Returns X coordinate in pixels corresponding to specific value. |
has( key: ) |
Returns Inherited from Returns Click here for more info |
height() |
Returns Inherited from Returns height of this element in pixels. |
hide( duration?: ) |
Returns Inherited from Hides the element and returns a series.hide().then(function(ev) { console.log("Series finished hiding"); }) series.hide().then(function(ev) { console.log("Series finished hiding"); }) |
hideTooltip() |
Returns Inherited from Hides element's |
hover() |
Returns Inherited from Simulate hover over element. |
innerHeight() |
Returns Inherited from Returns container's inner height (height without padding) in pixels. |
innerWidth() |
Returns Inherited from Returns container's inner width (width without padding) in pixels. |
isDisposed() |
Returns Inherited from Returns |
isDragging() |
Returns Inherited from Returns |
isFocus() |
Returns Inherited from Returns |
isHidden() |
Returns Inherited from Returns |
isHiding() |
Returns Inherited from Returns |
isHover() |
Returns Inherited from Returns |
isShowing() |
Returns Inherited from Returns |
isType( type: ) |
Returns Inherited from Checks if element is of certain class (or inherits one). |
isVisible() |
Returns Inherited from Returns |
isVisibleDeep() |
Returns Inherited from Same as @since 5.2.7 |
makeDataItem( data: ) |
Returns Inherited from Creates a new data item and processes it. |
markDirtyKey( key: ) |
Returns Inherited from Marks some setting as dirty. Could be used to trigger adapter. |
markDirtyValues( _dataItem?: ) |
Returns Inherited from Forces a repaint of the element which relies on data. @since 5.0.21 |
maxHeight() |
Returns Inherited from Returns maximum allowed height of this element in pixels. |
maxWidth() |
Returns Inherited from Returns maximum allowed width of this element in pixels. |
new( root: ) |
Static Returns Inherited from Use this method to create an instance of this class. Click here for more info |
off( key: ) |
Returns Inherited from Removes a callback for when value of a setting changes. Click here for more info |
offPrivate( key: ) |
Returns Inherited from Removes a callback for when value of a private setting changes. Click here for more info |
on( key: ) |
Returns Inherited from Sets a callback function to invoke when specific key of settings changes or is set. Click here for more info |
onPrivate( key: ) |
Returns Inherited from Sets a callback function to invoke when specific key of private settings changes or is set. Click here for more info |
positionToValue( position: ) |
Returns Inherited from Converts a relative position to a corresponding numeric value from axis scale. |
pushDataItem( data: ) |
Returns Inherited from Adds new explicit data item to series. |
remove( key: ) |
Returns Inherited from Removes a setting value for the specified Click here for more info |
removeAll() |
Returns Inherited from Removes all keys; Click here for more info |
scrollToChild( child: ) |
Returns Inherited from If scrolling is enabled on the Container (by adding @since 5.10.5 |
set( key: ) |
Returns Inherited from Sets a setting Click here for more info |
setAll( settings: ) |
Returns Inherited from Sets multiple settings at once. Click here for more info |
setTimeout( fn: () => ) |
Returns Inherited from Creates and returns a "disposable" timeout. |
show( duration?: ) |
Returns Inherited from Shows currently hidden element and returns a series.show().then(function(ev) { console.log("Series is now fully visible"); }) series.show().then(function(ev) { console.log("Series is now fully visible"); }) |
showTooltip( point?: ) |
Returns Inherited from Shows element's |
toAxisPosition( position: ) |
Returns Inherited from Converts relative position of the plot area to relative position of the axis with zoom taken into account. |
toBack() |
Returns Inherited from Moves sprite to the beginning of the parent's children array. Depending on |
toFront() |
Returns Inherited from Moves sprite to the end of the parent's children array. Depending on |
toGlobal( point: ) |
Returns Inherited from Converts X/Y coordinate within this element to a global coordinate. |
toGlobalPosition( position: ) |
Returns Inherited from Converts relative position of the axis to a global position taking current zoom into account (opposite to what @since 5.4.2 |
toLocal( point: ) |
Returns Inherited from Converts global X/Y coordinate to a coordinate within this element. |
unhover() |
Returns Inherited from Simulate unhover over element. |
updateTooltip() |
Returns Inherited from Can be called when axis zoom changes and you need to update tooltip position. |
valueToPosition( value: ) |
Returns Inherited from Convers value to a relative position on axis. |
width() |
Returns Inherited from Returns width of this element in pixels. |
x() |
Returns Inherited from Returns element's actual X position in pixels. |
y() |
Returns Inherited from Returns element's actual Y position in pixels. |
zoom( start: ) |
Returns Inherited from Zooms the axis to relative locations. Both |
zoomToValues( start: ) |
Returns Inherited from Zooms the axis to specific Optional |
There are 73 inherited items currently hidden from this list. |
Events
Add event handlers to DurationAxis object using its events.on()
method.
Read about adding event handlers.
#blur |
Param { originalEvent: Inherited from Invoked when element loses focus. |
---|---|
#boundschanged |
Param { type: Inherited from Invoked when element's bounds change due to any manipulation to it. |
#click |
Param { type: Inherited from Invoked when element is clicked or tapped. |
#dataitemchanged |
Param { newDataItem: Inherited from Invoked when element's data item changes. |
#datavalidated |
Param { type: Inherited from |
#dblclick |
Param { type: Inherited from Invoked when element is doubleclicked or tapped twice quickly. |
#dragged |
Param { type: Inherited from Invoked when element ois being dragged. |
#dragstart |
Param { type: Inherited from Invoked when element dragging starts. |
#dragstop |
Param { type: Inherited from Invoked when element dragging stops. |
#focus |
Param { originalEvent: Inherited from Invoked when element gains focus. |
#globalpointermove |
Param { type: Inherited from Invoked when pointer is moving anywhere in the window, even outside of the element or even chart area. |
#globalpointerup |
Param { type: Inherited from Invoked when pointer button is released or touch stops in the window, even outside of the element or even chart area. |
#middleclick |
Param { type: Inherited from Invoked when element is clicked with the middle mouse button. |
#pointerdown |
Param { type: Inherited from Invoked when pointer button is pressed or touch starts over the element. |
#pointerout |
Param { type: Inherited from Invoked when pointer moves outside the element. |
#pointerover |
Param { type: Inherited from Invoked when pointer moves over the element. |
#pointerup |
Param { type: Inherited from Invoked when pointer button is released or touch stops over the element. |
#positionchanged |
Param { type: Inherited from Invoked when element's position (X/Y) changes. |
#rightclick |
Param { type: Inherited from Invoked when element is clicked width the right mouse button. |
#wheel |
Param { originalEvent: Inherited from Invoked when mouse wheel is spinned while pointer is over the element. |
There are 20 inherited items currently hidden from this list. |