Template
Type class
Settings, states, adapters and events shared by many objects, such as all columns of a series. A setting on the template reaches every object that uses it, unless the object has its own value.
Sources
Template can be used (imported) via one of the following packages.
// Import Templateimport * as am5 from "@amcharts/amcharts5";
// Create Templateam5.Template.new(root, { // ... config if applicable});<!-- Load Template --><script src="index.js"></script>
<script>// Create Templateam5.Template.new(root, { // ... config if applicable});</script>Inheritance
Template does not extend any other symbol.
Template is not extended by any other symbol.
Settings
Set these settings on a Template object using its set() and setAll() methods. Read about settings concept.
Template does not have any settings.
Properties
adaptersType
TemplateAdaptersDefaultnew TemplateAdapters()Adapters added to the objects that use the template.
entitiesType
ArrayThe objects that use the template.
eventsType
EventDispatcherDefaultnew EventDispatcher()Event listeners added to the objects that use the template.
setupType (entity:
O) =>void|undefinedA function called once for each object that uses the template, when the template is first applied to it.
statesType
TemplateStatesDefaultnew TemplateStates(this)States passed on to the objects that use the template.
Methods
constructor(settings:IESettings,
isReal:boolean)Returns
Templatedispose()Returns
voidDisposes the template, along with any disposable objects in its settings.
get(key:Key)Returns
[""]Returns the template's value of setting
key, orfallbackif it has none.getPrivate(key:Key,
fallback:F)Returns
NonNullable|FReturns the template's value of private setting
key, orfallbackif it has none.isDisposed()Returns
booleanReturns
trueif the template has been disposed.new(settings:IESettings)StaticReturns
TemplateCreates a template with
settings.More info: Getting started: new element syntax
on(key:Key,
callback: (value:[""], target:E, key:Key) =>void)Returns
IDisposerCalls
callbackeach time settingkeychanges on an object that uses the template.onPrivate(key:Key,
callback: (value:[""], target:E, key:Key) =>void)Returns
IDisposerCalls
callbackeach time private settingkeychanges on an object that uses the template.remove(key:Key)Returns
voidRemoves setting
keyfrom the template. The objects that use it go back to a value from a theme or other template, if there is one.removeAll()Returns
voidRemoves all settings from the template, as
remove()does for each one.removePrivate(key:Key)Returns
voidRemoves private setting
keyfrom the template.set(key:Key,
value:[""])Returns
voidSets setting
keyon the template, and on every object that uses it and has no value of its own.setAll(value:Partial)Returns
voidSets several settings at once, as
set()does for each one.setPrivate(key:Key,
value:Value)Returns
ValueSets private setting
keyon the template, and on every object that uses it and has no value of its own. Returnsvalue.setPrivateRaw(key:Key,
value:Value)Returns
ValueSets private setting
keyon the template only, without passing it on to the objects that use it. Returnsvalue.setRaw(key:Key,
value:[""])Returns
voidSets setting
keyon the template only, without passing it on to the objects that use it.
Events
Template does not have any events.