Type class
The root of a chart: it ties the chart to an HTML element and holds its global settings, formatters, locale and themes.
Click here for more info
Sources
Root can be used (imported) via one of the following packages.
// Import Root
import * as am5 from "@amcharts/amcharts5";
// Create Root
am5.Root.new(root, {
// ... config if applicable
});
<!-- Load Root -->
<script src="index.js"></script>
<script>
// Create Root
am5.Root.new(root, {
// ... config if applicable
});
</script>
Inheritance
Root does not extend any other symbol.
Root is not extended by any other symbol.
Settings
Root does not have any settings.
Private settings
Root does not have any private settings.
Properties
|
autoResize # |
Type Default Resizes the chart automatically when its container's size changes. With |
|---|---|
|
container # |
Type The main container: charts and other elements go into its |
|
dateFormatter # |
Type Default Date/time formatter. Click here for more info |
|
defaultRenderer # |
Static
Type Default Renderer for Roots that do not set @since 5.21.0 |
|
dom # |
Type The HTML element the chart is in. |
|
durationFormatter # |
Type Default Duration formatter. Click here for more info |
|
entitiesById # |
Type Objects of this root that have an @since 5.11.0 |
|
events # |
Type Default Root's event dispatcher. Click here for more info |
|
fps # |
Type Maximum frames per second. When not set, the chart renders on every animation frame of the browser. Click here for more info |
|
gridLayout # |
Type Default A shared |
|
horizontalLayout # |
Type Default A shared |
|
interfaceColors # |
Type Colors of the chart's interface: text, grid, buttons and other controls. Click here for more info |
|
locale # |
Type Default Locale for the chart's texts and formatting. English by default. |
|
nonce # |
Type Nonce for the |
|
numberFormatter # |
Type Default Number formatter. Click here for more info |
|
settings # |
Type The Root's settings. |
|
skipRenderFrame # |
Type Default |
|
systemTooltip # |
Type A shared @since 5.14.0 |
|
tabindex # |
Type Default Tab index for the whole chart. Click here for more info |
|
tapToActivate # |
Type Default Makes touch gestures such as zoom and pan work only after a tap on the chart, so the page can still be scrolled over it. Click here for more info |
|
tapToActivateTimeout # |
Type Default How long in milliseconds the chart stays active after the last touch, with
Click here for more info |
|
timezone # |
Type Time zone to show dates in, instead of the user's local one. Set it to a
Every date is converted, which can slow down charts with large data sets. Click here for more info |
|
tooltipContainer # |
Type The |
|
updateTick # |
Type Whether the chart updates and redraws. Stops the chart from updating and redrawing with |
|
utc # |
Type Default Treats dates as UTC instead of the user's local time, when formatting and parsing them and when placing date axis grid. It takes precedence over Click here for more info |
|
verticalLayout # |
Type Default A shared |
Methods
|
dispose() |
Returns Disposes the Root and everything in it, and removes the chart from the page. |
|---|---|
|
documentPointToRoot( point: ) |
Returns Converts a point from viewport coordinates, such as a pointer event's |
|
eachFrame( f: ( currentTime: ) |
Returns Calls a function on every frame, which keeps the chart rendering, until the returned disposer is disposed. |
|
focused( target: ) |
Returns Returns |
|
height() |
Returns Returns the chart's height in pixels: the container's, or the one from |
|
isDisposed() |
Returns Returns |
|
markDirtyGlobal( container?: ) |
Returns Makes every element inside a container update and re-measure on the next frame. |
|
moveDOM( id: ) |
Returns Moves the chart to another HTML element and resizes it to fit there. Nothing happens if no element with that |
|
new( id: ) |
Static Returns Creates a Root in an HTML element. An element can hold only one Root: creating another one there throws an error, unless |
|
readerAlert( text: ) |
Returns Makes screen readers read out a message. Click here for more info |
|
resize() |
Returns Resizes the chart to fit its container. Call it after the container's size changes when |
|
rootPointToDocument( point: ) |
Returns Converts a point from coordinates within the root to viewport coordinates, as in a pointer event's |
|
setThemes( themes: ) |
Returns Sets the chart's themes, replacing any set before. Click here for more info |
|
width() |
Returns Returns the chart's width in pixels: the container's, or the one from |
Events
Add event handlers to Root object using its events.on() method.
Read about adding event handlers.
| #frameended |
Param { timestamp: A frame finished rendering. |
|---|---|
| #framestarted |
Param { timestamp: A frame started rendering. |