SVGContainer
Type class
A class used to create an HTML wrapper for the SVG contents.
Sources
SVGContainer can be used (imported) via one of the following packages.
/** * Import from: "core.ts" * Use like: am4core.SVGContainer */import * as am4core from "@amcharts/amcharts4/core";/** * Include via: <script src="core.js"></script> * Access items like: am4core.SVGContainer */Inheritance
SVGContainer does not extend any other symbol.
SVGContainer is not extended by any other symbol.
Properties
autoResizeType
BooleanDefaulttrueIf this component is in a separate HTML container,
autoResizemeans the module will constantly measure container's size and adopt contents to it.containerType
$type.Optional<Container>A
Containerelement which is placed into container.cssScaleType
numberDefault1heightType
$type.Optional<number>Height of HTML element.
hideOverflowType
booleanIndicates if chart container should have its style set to
overflow: hidden.Normally, we don't want that, so that certain elements, such as tooltips, would be able to go outside chart area.
There is one issue though. Some browsers ignore SVG masks and would display scrollbars if chart elements, that go outside chart area extend outside window.
This is especially true for
MapChart, which can have its elements extend very widely when zoomed in. Even if those parts are not visible because of SVG masks, some browsers might still display window scrollbars.This is why we set this setting to
trueinMapChart.Other charts use default of
false.htmlElementType
HTMLElementA parent HTML container that SVG wrapper element is placed in.
modalType
ModalReturns a
Modalinstance, associated with this chart.(elements top parent)Accessing modal does not make it appear. To make a modal appear, use
showModal()method.More info:
Modalrmation about using Modal windowspopupsType
ListTemplate<Popup>A list of popups for this chart.
readerAlertElementType
HTMLDivElementA
<div>element used as as placeholder to trigger screen alerts.SVGContainerType
HTMLDivElementA
<div>element which acts as a wrapper/holder for the SVG element.widthType
$type.Optional<number>Width of HTML element.
Methods
closeAllPopups()Returns
voidCloses all currently open popup windows
closeModal()Returns
voidHides modal window if there is one currently open.
constructor(htmlElement:HTMLElement,
ghost?:boolean)Returns
SVGContainerConstructor
- Creates an HTML wrapper for SVG
dispose()Returns
voidRemoves this container from SVG container list in system, which effectively disables size change monitoring for it.
initSensor()Returns
void(Re)Initializes a resize sensor.
isDisposed()Returns
booleanReturns if this object has been already been disposed.
openModal(text:string,
title?:string)Returns
ModalOpens a modal window with specific content (
textparameter) and, optionally,title.The
textparameter can contain HTML content.More info:
Modalrmation about using Modal windowsopenPopup(text:string,
title?:string)Returns
PopupCreates, opens, and returns a new
Popupwindow.textcan be any valid HTML.titleis currently not supported.readerAlert(text:string)Returns
voidSince 4.9.2Triggers screen reader read out a message.
Events
SVGContainer does not have any events.