Type class
A grid line of an axis, drawn across the plot area.
Click here for more info
Sources
Grid can be used (imported) via one of the following packages.
// Import Grid
import * as am5xy from "@amcharts/amcharts5/xy";
// Create Grid
am5xy.Grid.new(root, {
// ... config if applicable
});
<!-- Load Grid -->
<script src="xy.js"></script>
<script>
// Create Grid
am5xy.Grid.new(root, {
// ... config if applicable
});
</script>
Inheritance
Grid extends Graphics.
Grid is not extended by any other symbol.
Settings
Set these settings on a Grid object using its set() and setAll() methods.
Read about settings concept.
|
active # |
Type Inherited from Applies the element's |
|---|---|
|
animations # |
Type Inherited from Animations the element plays on its own, described as data - so they can be set from a JSON config and saved with it. Each one animates a setting of the element (or, with sprite.set("animations", [
{ key: "rotation", to: 360, duration: 4000, loops: 0 },
{ key: "scale", from: 1, to: 1.3, duration: 800, loops: 0, yoyo: true, easing: "sine" }
]);
@since 5.20.8 |
|
appearDelay # |
Type Default Inherited from Milliseconds to wait before the @since 5.21.0 |
|
appearDuration # |
Type Inherited from Duration of the @since 5.21.0 |
|
ariaChecked # |
Type Inherited from
This setting is ignored unless
|
|
ariaControls # |
Type Inherited from
|
|
ariaCurrent # |
Type Inherited from
Click here for more info |
|
ariaExpanded # |
Type Inherited from
Click here for more info |
|
ariaHidden # |
Type Inherited from
|
|
ariaLabel # |
Type Inherited from Label for the element to use for screen readers. Click here for more info |
|
ariaLive # |
Type Inherited from
|
|
ariaOrientation # |
Type Inherited from
|
|
ariaSelected # |
Type Inherited from
Click here for more info |
|
ariaValueMax # |
Type Inherited from
|
|
ariaValueMin # |
Type Inherited from
|
|
ariaValueNow # |
Type Inherited from
|
|
ariaValueText # |
Type Inherited from
|
|
autoAppear # |
Type Default Inherited from Plays the element's reveal animation, as Elements made from a template play as each one is made. An element that starts hidden ( This is how a JSON config gets the opening animation, as a config cannot call chart.setAll({ autoAppear: true, appearDuration: 1000, appearDelay: 100 });
series.setAll({ autoAppear: true, appearDuration: 1000 });
chart.setAll({ autoAppear: true, appearDuration: 1000, appearDelay: 100 });
series.setAll({ autoAppear: true, appearDuration: 1000 });
Click here for more info |
|
blur # |
Type Inherited from Blur radius in pixels, from IMPORTANT: This setting is not supported in Safari browsers. Click here for more info |
|
brightness # |
Type Inherited from Brightness.
Click here for more info |
|
centerX # |
Type Inherited from The point of the element that is placed at its |
|
centerY # |
Type Inherited from The point of the element that is placed at its |
|
clickAnnounceText # |
Type Inherited from If set, the text will be read out (announced) by a screen reader when focused element is "clicked" (by pressing ENTER or SPACE). @since 5.10.8 |
|
contrast # |
Type Inherited from Contrast.
Click here for more info |
|
crisp # |
Type Default Inherited from Draws the element sharply, with minimal anti-aliasing: its position is rounded to whole pixels, and NOTE: it may not work well on several elements that are meant to fit together exactly. @since 5.3.0 |
|
cursorOverStyle # |
Type Inherited from CSS cursor to show while the pointer is over the element, e.g.
Click here for more info |
|
dateFormatter # |
Type Inherited from A Click here for more info |
|
disabled # |
Type Inherited from Applies the element's |
|
draggable # |
Type Inherited from Lets the user drag the element. Touches that start on it no longer scroll the page. |
|
draw # |
Type Inherited from Drawing function. Must use renderer ( Click here for more info |
|
durationFormatter # |
Type Inherited from A 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. |
|
exportable # |
Type Inherited from If |
|
fill # |
Type Inherited from Fill color. Click here for more information |
|
fillGradient # |
Type Inherited from Fill gradient. Click here for more information |
|
fillOpacity # |
Type Inherited from Opacity of the fill, from |
|
fillPattern # |
Type Inherited from Fill pattern. Click here for more information |
|
focusable # |
Type Inherited from Can element be focused, i.e. selected using TAB key. Click here for more info |
|
focusableGroup # |
Type Inherited from An identifier by which to group common elements into focusable groups. If set, only the first element in he group will be focusable via TAB key. When it is selected, the rest of the elements in the same group can be selected using arrow keys. It allows users to TAB-through chart elements quickly without the need to TAB into each and every element. It's up to implementer of the charts to provide meaningful Click here for more info |
|
forceHidden # |
Type Inherited from Hides the element whatever its |
|
forceInactive # |
Type Inherited from Makes the element and its children ignore the pointer, even with @since 5.0.21 |
|
height # |
Type Inherited from Height in pixels, or a |
|
hoverOnFocus # |
Type Inherited from Simulate hover on an element when it gains focus, including changing hover appearance and displaying a tooltip if applicable. Click here for more info |
|
hue # |
Type Inherited from Rotates the hue of all colors by this many degrees, from IMPORTANT: This setting is not supported in Safari browsers. Click here for more info |
|
id # |
Type Inherited from A unique ID for looking the element up in |
|
ignoreThemes # |
Type Default Inherited from Ignores themes: no theme rule applies to the element, not even one of the default theme. @since 5.15.6 |
|
interactive # |
Type Inherited from Makes the element respond to the pointer. Adding a pointer event listener to it turns this on. |
|
invert # |
Type Inherited from Color inversion, from IMPORTANT: This setting is not supported in Safari browsers. Click here for more info |
|
isMeasured # |
Type Default Inherited from If |
|
layer # |
Type Inherited from Layer to draw the element on: elements on higher layers show in front of those on lower ones. If not set, the element is on its parent's layer. |
|
layerMargin # |
Type Inherited from Margins in pixels that make the element's layer larger than the chart, or, when negative, smaller. @since @5.2.39 |
|
lineCap # |
Type Default Inherited from Shape of the end points of lines. Click here for more info |
|
lineJoin # |
Type Default Inherited from Shape of the joints of a multi-point line. Click here for more info |
|
location # |
Type Default Where the grid line sits within its cell, from A cell is a category, a date period, or the span of an axis range. 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. |
|
maxHeight # |
Type Inherited from Maximum allowed height in pixels. |
|
maxWidth # |
Type Inherited from Maximum allowed width in pixels. |
|
minHeight # |
Type Inherited from Minimum allowed height in pixels. |
|
minWidth # |
Type Inherited from Minimum allowed width in pixels. |
|
nonScalingStroke # |
Type Default Inherited from Keeps the stroke width the same when the element's |
|
numberFormatter # |
Type Inherited from A Click here for more info |
|
opacity # |
Type Default Inherited from Opacity, from |
|
position # |
Type Default Inherited from Positioning of the element. |
|
role # |
Type Inherited from Element's role. Click here for more info |
|
rotation # |
Type Default Inherited from Rotation in degrees, clockwise, around the point set by |
|
saturate # |
Type Inherited from Saturation.
Click here for more info |
|
scale # |
Type Default Inherited from Scale, around the point set by |
|
sepia # |
Type Inherited from Sepia tone, from IMPORTANT: This setting is not supported in Safari browsers. Click here for more info |
|
shadowBlur # |
Type Inherited from Blurriness of the shadow: the bigger the number, the blurrier the shadow. Click here for more info |
|
shadowColor # |
Type Inherited from Color of the element's shadow. It shows only when Click here for more info |
|
shadowOffsetX # |
Type Inherited from Horizontal shadow offset in pixels. Click here for more info |
|
shadowOffsetY # |
Type Inherited from Vertical shadow offset in pixels. Click here for more info |
|
shadowOpacity # |
Type Inherited from Opacity of the shadow, from Click here for more info |
|
showTooltipOn # |
Type Default Inherited from When the element's tooltip shows:
Click here for more info |
|
stateAnimationDuration # |
Type Default Inherited from How long, in milliseconds, a switch from one state to another animates.
|
|
stateAnimationEasing # |
Type Default Inherited from Easing of the animated switch from one state to another. |
|
stroke # |
Type Inherited from Stroke (border or line) color. Click here for more information |
|
strokeDasharray # |
Type Inherited from Dash pattern of the stroke (border or line): lengths in pixels of dashes and gaps, e.g. Click here for more information |
|
strokeDashoffset # |
Type Inherited from Stroke (border or line) dash offset. Click here for more information |
|
strokeGradient # |
Type Inherited from Stroke (border or line) gradient. Click here for more information |
|
strokeOpacity # |
Type Inherited from Opacity of the stroke (border or line), from |
|
strokePattern # |
Type Inherited from Stroke (border or line) pattern. Click here for more information |
|
strokeWidth # |
Type Default Inherited from Width of the stroke (border or line) in pixels. |
|
svgPath # |
Type Inherited from SVG path data (as in the Click here for more information |
|
tabindexOrder # |
Type Inherited from An internal order by which focusable elements will be selected within the chart. Click here for more info |
|
templateField # |
Type Inherited from Field in the data item's data object that holds settings for this element, applied over its template's. Click here for more info |
|
themeTags # |
Type Inherited from Tags that theme rules can target. They also count for the element's children, so a rule can match a child by a tag of its parent. Click here for more info |
|
themeTagsSelf # |
Type Inherited from Tags that theme rules can target, like Click here for more info |
|
themes # |
Type Inherited from Themes applied to the element and everything inside it. |
|
toggleKey # |
Type Inherited from Setting that a click or tap toggles between
|
|
tooltip # |
Type Inherited from The |
|
tooltipHTML # |
Type Inherited from HTML content of the element's tooltip, shown in place of @since 5.2.11 |
|
tooltipPosition # |
Type Default Inherited from Where the tooltip points: |
|
tooltipText # |
Type Inherited from Text of the element's tooltip. It can hold data placeholders, such as |
|
tooltipX # |
Type Default Inherited from Where on the element the tooltip points, horizontally: pixels from its left edge, or a percent of its width. |
|
tooltipY # |
Type Default Inherited from Where on the element the tooltip points, vertically: pixels from its top edge, or a percent of its height. |
|
userData # |
Type Inherited from Any data of your own to keep with the element. |
|
visible # |
Type Default Inherited from Whether the element is shown. Unlike |
|
wheelable # |
Type Inherited from Makes the element receive mouse wheel events. While the pointer is over it, the wheel no longer scrolls the page. |
|
width # |
Type Inherited from Width in pixels, or a |
|
x # |
Type Inherited from X position in the parent: pixels from its left edge, or a |
|
y # |
Type Inherited from Y position in the parent: pixels from its top edge, or a |
| There are 105 inherited items currently hidden from this list. | |
Private settings
These are read-only settings accessible from a Grid object using its getPrivate() method.
Read about private settings.
|
focusable # |
Read only
Type Inherited from If set to @since 5.3.16 |
|---|---|
|
lastTooltipCoords # |
Read only
Type Inherited from The last point the tooltip was shown at, so it is not shown again at the same place. @since 5.11.3 |
|
showingTooltip # |
Read only
Type Inherited from
|
|
tooltipTarget # |
Read only
Type Inherited from An element whose tooltip point and colors the tooltip uses, in place of this element's. |
|
trustBounds # |
Read only
Type Inherited from Checks that the pointer is within the element's bounds before dispatching It is @since 5.5.0 |
| There are 5 inherited items currently hidden from this list. | |
Properties
|
adapters # |
Type Default Inherited from |
|---|---|
|
className # |
Static
Type Default |
|
classNames # |
Static
Type Default |
|
dataItem # |
Type Inherited from The element's NOTE: data items are assigned automatically in most cases where it matters. Set one only if you know what you are doing. |
|
enableDispose # |
Type Default Inherited from Set to |
|
events # |
Inherited from |
|
parent # |
Type Inherited from Parent |
|
root # |
Type Inherited from The @readonly |
|
states # |
Type Default Inherited from |
|
template # |
Type Inherited from A |
|
uid # |
Type Default Inherited from A unique number, given to each object as it is created. |
|
virtualParent # |
Type Inherited from |
| There are 10 inherited items currently hidden from this list. | |
Methods
|
animate( options: ) |
Returns Inherited from Animates a setting from its current value (or Click here for more info |
|---|---|
|
appear( duration?: ) |
Returns Inherited from Plays the reveal animation: hides the element at once, then shows it, whether it was hidden or not. |
|
compositeOpacity() |
Returns Inherited from Returns the element's opacity multiplied by those of all its parents. @since 5.2.11 |
|
compositeRotation() |
Returns Inherited from Returns the element's rotation plus those of all its parents, in degrees. @since 5.9.2 |
|
compositeScale() |
Returns Inherited from Returns the element's scale multiplied by those of all its parents. @since 5.9.2 |
|
depth() |
Returns Inherited from Returns how deep the element is in the tree: the number of parents it has. |
|
dispose() |
Returns Inherited from Disposes the object, freeing everything it holds. A disposed object can't be used again. |
|
get( key: ) |
Returns Inherited from Returns the value of setting Click here for more info |
|
getDateFormatter() |
Returns Inherited from Returns the Click here for more info |
|
getDurationFormatter() |
Returns Inherited from Returns the Click here for more info |
|
getNumberFormatter() |
Returns Inherited from Returns the Click here for more info |
|
getTooltip() |
Returns Inherited from Returns the element's |
|
has( key: ) |
Returns Inherited from Returns Click here for more info |
|
height() |
Returns Inherited from Returns the element's height 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 the element's |
|
hover() |
Returns Inherited from Hovers the element as if the pointer were over it: applies its hover state and shows its tooltip. |
|
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 Returns |
|
isVisible() |
Returns Inherited from Returns |
|
isVisibleDeep() |
Returns Inherited from Same as @since 5.2.7 |
|
markDirtyKey( key: ) |
Returns Inherited from Marks a setting as changed, so the element reads it again, running its adapters, on the next frame. |
|
maxHeight() |
Returns Inherited from Returns the most height the element may take, in pixels: its |
|
maxWidth() |
Returns Inherited from Returns the most width the element may take, in pixels: its |
|
new( root: ) |
Static Returns Inherited from Creates an instance of the class. Use it instead of Click here for more info |
|
off( key: ) |
Returns Inherited from Removes a callback added with Click here for more info |
|
offDebounced( key: ) |
Returns Inherited from Removes a callback added with Click here for more info |
|
offDebouncedPrivate( key: ) |
Returns Inherited from Removes a callback added with Click here for more info |
|
offPrivate( key: ) |
Returns Inherited from Removes a callback added with Click here for more info |
|
on( key: ) |
Returns Inherited from Calls Click here for more info |
|
onDebounced( key: ) |
Returns Inherited from Like Click here for more info |
|
onPrivate( key: ) |
Returns Inherited from Calls Click here for more info |
|
onPrivateDebounced( key: ) |
Returns Inherited from Like Click here for more info |
|
once( key: ) |
Returns Inherited from Like Click here for more info |
|
onceDebounced( key: ) |
Returns Inherited from Like Click here for more info |
|
remove( key: ) |
Returns Inherited from Removes the value set for setting Click here for more info |
|
removeAll() |
Returns Inherited from Removes all settings, as Click here for more info |
|
set( key: ) |
Returns Inherited from Sets setting Click here for more info |
|
setAll( settings: ) |
Returns Inherited from Sets several settings at once, from an object of key-value pairs. Click here for more info |
|
setTimeout( fn: () => ) |
Returns Inherited from Calls |
|
show( duration?: ) |
Returns Inherited from Shows the 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 the element's |
|
toBack() |
Returns Inherited from Moves the element to the start of its parent's children, so it is drawn under its siblings, or, in a layout, placed first. |
|
toFront() |
Returns Inherited from Moves the element to the end of its parent's children, so it is drawn over its siblings, or, in a layout, placed last. |
|
toGlobal( point: ) |
Returns Inherited from Converts a point within the element to a point relative to the root. |
|
toLocal( point: ) |
Returns Inherited from Converts a point relative to the root to a point within the element. |
|
unhover() |
Returns Inherited from Ends a hover, as if the pointer left the element: hides its tooltip and takes it out of its hover state. |
|
width() |
Returns Inherited from Returns the element's width in pixels. |
|
x() |
Returns Inherited from Returns the element's X position in pixels, relative to its parent, without |
|
y() |
Returns Inherited from Returns the element's Y position in pixels, relative to its parent, without |
| There are 56 inherited items currently hidden from this list. | |
Events
Add event handlers to Grid 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 The element's bounds changed. |
| #click |
Param { type: Inherited from The element was clicked or tapped. A press and release more than 5 pixels apart is not a click. |
| #dataitemchanged |
Param { newDataItem: Inherited from The element's data item changed. |
| #dblclick |
Param { type: Inherited from The element was double-clicked or double-tapped. Also dispatched on its parents. |
| #dragged |
Param { type: Inherited from The element moved while being dragged. |
| #dragstart |
Param { type: Inherited from Dragging of the element started: the pointer moved more than 5 pixels after pressing on it. |
| #dragstop |
Param { type: Inherited from Dragging of the element stopped. |
| #focus |
Param { originalEvent: Inherited from Invoked when element gains focus. |
| #globalpointerdown |
Param { type: Inherited from A pointer button was pressed, or a touch started, anywhere in the window, even outside the chart. |
| #globalpointermove |
Param { type: Inherited from The pointer moved anywhere in the window, even outside the chart. |
| #globalpointerup |
Param { type: Inherited from A pointer button was released, or a touch ended, anywhere in the window, even outside the chart. |
| #middleclick |
Param { type: Inherited from The element was clicked with the middle mouse button. |
| #pointerdown |
Param { type: Inherited from A pointer button was pressed, or a touch started, over the element. Also dispatched on its parents. |
| #pointerout |
Param { type: Inherited from The pointer left the element. |
| #pointerover |
Param { type: Inherited from The pointer moved over the element. |
| #pointerup |
Param { type: Inherited from A pointer button was released, or a touch ended, over the element. |
| #positionchanged |
Param { type: Inherited from The element's position changed. |
| #rightclick |
Param { type: Inherited from The element was clicked with the right mouse button. |
| #wheel |
Param { originalEvent: Inherited from The mouse wheel turned while the pointer was over the element. Also dispatched on its parents. |
| There are 20 inherited items currently hidden from this list. | |