Paper

Type class

Paper class which when instantiated will create an SVG element as well as some of the sub-elements like <desc>, <defs>.

Use its methods like addGroup and append to add elements to the paper.

Sources

Paper can be used (imported) via one of the following packages.

/**
 * --------------------------------------------------------
 * Import from: "core.ts"
 * Use like: am4core.Paper
 * --------------------------------------------------------
 */
import * as am4core from "@amcharts/amcharts4/core";

/**
 * --------------------------------------------------------
 * Include via: <script src="core.js"></script>
 * Access items like: am4.Paper
 * --------------------------------------------------------
 */

Inheritance

Paper does not extend any other symbol.

Paper is not extended by any other symbol.

Properties

container
#

Type HTMLElement

A reference to the HTML container the <svg> element is placed in.

defs
#

Type SVGDefsElement

A reference to the <defs> element.

id
#

Type string

An id of the element.

svg
#

Type SVGSVGElement

A reference <svg> element.

Methods

add(

elementName: SVGElementNames

)

#

Returns AMElement

Creates and returns a new element. Does not attach it to Paper yet.

addGroup(

groupName: SVGElementNames

)

#

Returns Group

Creates and returns a new Group element. Does not attach it to Paper.

append(

element: AMElement

)

#

Returns void

Appends an element to Paper.

appendDef(

element: AMElement

)

#

Returns void

Appends an element to <defs> block of the Paper.

constructor(

container: HTMLElement,
id: string

)

#

Returns Paper

Creates main <svg> container and related elements.

foreignObject()

#

Returns AMElement

Creates and returns new <foreignObject> element. Does not append it to Paper.

supportsForeignObject()

#

Returns boolean

Checks if browser supports <foreignObject> elements.

Events

Paper does not have any events.

Adapters

Paper does not have any adapters.