SettingsModal

Type class

Used to display a modal dialog with HTML content.

Sources

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

// Import SettingsModal
import * as am5stock from "@amcharts/amcharts5/stock";

// Create SettingsModal
am5stock.SettingsModal.new(root, {
  // ... config if applicable
});
<!-- Load SettingsModal -->
<script src="stock.js"></script>

<script>
// Create SettingsModal
am5stock.SettingsModal.new(root, {
  // ... config if applicable
});
</script>

Inheritance

SettingsModal extends Modal.

SettingsModal is not extended by any other symbol.

Settings

Set these settings on a SettingsModal object using its set() and setAll() methods.

Read about settings concept.

content
#

Type undefined | string

Inherited from IModalSettings

HTML content of the modal.

deactivateRoot
#

Type undefined | false | true

Default true

Inherited from IModalSettings

When modal is open, all interactions for the underlying chart will be disabled.

@since 5.2.11

id
#

Type undefined | string

Inherited from IEntitySettings

A custom string ID for the element.

If set, element can be looked up via root.entitiesById.

Will raise error if an element with the same ID already exists.

ignoreThemes
#

Type undefined | false | true

Default false

Inherited from IEntitySettings

If set to true the themes will be ignored when applying settings.

@since 5.15.6

showResetLink
#

Type undefined | false | true

Default true

Show the "Reset to default" link?

@since 5.9.0

stateAnimationDuration
#

Type undefined | number

Default 0

Inherited from IEntitySettings

Duration of transition from one state to another.

stateAnimationEasing
#

Type $ease.Easing

Default out(cubic)

Inherited from IEntitySettings

Easing of transition from one state to another.

stockChart
#

Type StockChart

A target StockChart.

strokeWidths
#

Type number[]

Default [1,
2,
4,
10]

Available line widths for user to choose from.

@since 5.11.2

themeTags
#

Type Array

Inherited from IEntitySettings

Tags which can be used by the theme rules.

Click here for more info

themeTagsSelf
#

Type Array

Inherited from IEntitySettings

Tags which can be used by the theme rules.

These tags only apply to this object, not any children.

Click here for more info

themes
#

Type Array

Inherited from IEntitySettings

A list of themes applied to the element.

userData
#

Type any

Inherited from IEntitySettings

A storage for any custom user data that needs to be associated with the element.

There are 10 inherited items currently hidden from this list.

Private settings

These are read-only settings accessible from a SettingsModal object using its getPrivate() method.

Read about private settings.

container
#

Read only

Type HTMLDivElement

Inherited from IModalPrivate

content
#

Read only

Type HTMLDivElement

Inherited from IModalPrivate

curtain
#

Read only

Type HTMLDivElement

Inherited from IModalPrivate

wrapper
#

Read only

Type HTMLDivElement

Inherited from IModalPrivate

There are 4 inherited items currently hidden from this list.

Properties

adapters
#

Type Adapters

Default new Adapters(this)

Inherited from Entity

className
#

Static

Type string

Default "SettingsModal"

classNames
#

Static

Type Array

Default "SettingsModal", "Modal", "Entity"

enableDispose
#

Type boolean

Default true

Inherited from Settings

If this is set to false then disposing does nothing, it's a no-op.

events
#

Type EventDispatcher

Default this._createEvents()

Inherited from Entity

root
#

Type Root

Inherited from Entity

An instance of Root object.

@readonly
@since 5.0.6

states
#

Type States

Default new States(this)

Inherited from Entity

template
#

Type Template | undefined

Inherited from Entity

@todo needs description

uid
#

Type number

Default ++counter

Inherited from Settings

Unique ID.

There are 7 inherited items currently hidden from this list.

Methods

animate(

options: AnimationOptions

)

#

Returns Animation

Inherited from Settings

Animates setting values from current/start values to new ones.

Click here for more info

cancel()

#

Returns void

Closes the modal without applying any changes.

clear()

#

Returns void

Clears contents of the modal.

close()

#

Returns void

Closes the modal, saving settings.

dispose()

#

Returns void

Inherited from Settings

Disposes this object.

get(

key: Key,
fallback: F

)

#

Returns NonNullable | F

Inherited from Entity

Returns settings value for the specified key.

If there is no value, fallback is returned instead (if set).

Click here for more info

has(

key: Key

)

#

Returns boolean

Inherited from Settings

Returns true if the setting exists.

Click here for more info

isDisposed()

#

Returns boolean

Inherited from Settings

Returns true if this element is disposed.

isOpen()

#

Returns boolean

Inherited from Modal

Returns true if modal is currently open.

isType(

type: string

)

#

Returns this

Inherited from Entity

Checks if element is of certain class (or inherits one).

new(

root: Root,
settings: ITSettings,
template?: Template

)

#

Static

Returns T

Inherited from Entity

Use this method to create an instance of this class.

Click here for more info

off(

key: Key,
callback?: undefined | ( value: [""], target: this, key: Key) => void

)

#

Returns void

Inherited from Settings

Removes a callback for when value of a setting changes.

Click here for more info
@since 5.9.2

offDebounced(

key: Key,
callback?: undefined | ( value: [""], target: this, key: Key) => void

)

#

Returns void

Inherited from Settings

Removes a debounced callback for when value of a setting changes.

Click here for more info

offDebouncedPrivate(

key: Key,
callback?: undefined | ( value: [""], target: this, key: Key) => void

)

#

Returns void

Inherited from Settings

Removes a debounced callback for when value of a private setting changes.

Click here for more info

offPrivate(

key: Key,
callback?: undefined | ( value: [""], target: this, key: Key) => void

)

#

Returns void

Inherited from Settings

Removes a callback for when value of a private setting changes.

Click here for more info
@since 5.9.2

on(

key: Key,
callback: ( value: [""], target: this, key: Key) => void

)

#

Returns IDisposer

Inherited from Settings

Sets a callback function to invoke when specific key of settings changes or is set.

Click here for more info

onDebounced(

key: Key,
callback: ( value: [""], target: this, key: Key) => void,
debounceDelay: number

)

#

Returns IDisposer

Inherited from Settings

Sets a debounced callback function to invoke when specific key of settings changes or is set. The callback fires only once even if the setting is changed multiple times within the debounce delay.

Click here for more info

onPrivate(

key: Key,
callback: ( value: [""], target: this, key: Key) => void

)

#

Returns IDisposer

Inherited from Settings

Sets a callback function to invoke when specific key of private settings changes or is set.

Click here for more info

onPrivateDebounced(

key: Key,
callback: ( value: [""], target: this, key: Key) => void,
debounceDelay: number

)

#

Returns IDisposer

Inherited from Settings

Sets a debounced callback function to invoke when specific key of private settings changes or is set. The callback fires only once even if the setting is changed multiple times within the debounce delay.

Click here for more info

open()

#

Returns void

Inherited from Modal

Opens modal.

openIndicator(

target: Indicator

)

#

Returns void

Opens settings modal for an Indicator.

openSeries(

series: XYSeries

)

#

Returns void

Opens settings editing for the any XYSeries.

remove(

key: Key

)

#

Returns void

Inherited from Entity

Removes a setting value for the specified key.

Click here for more info

removeAll()

#

Returns void

Inherited from Settings

Removes all keys;

Click here for more info

set(

key: Key,
value: Value

)

#

Returns Value

Inherited from Entity

Sets a setting value for the specified key, and returns the same value.

Click here for more info

setAll(

settings: Partial

)

#

Returns void

Inherited from Settings

Sets multiple settings at once.

settings must be an object with key: value pairs.

Click here for more info

setTimeout(

fn: () => void,
delay: number

)

#

Returns IDisposer

Inherited from Entity

Creates and returns a "disposable" timeout.

There are 22 inherited items currently hidden from this list.

Events

Add event handlers to SettingsModal object using its events.on() method.

Read about adding event handlers.

#cancelled

Param { type: "cancelled",
  target: this }

Inherited from IModalEvents

#closed

Param { type: "closed",
  target: this }

Inherited from IModalEvents

#done

Param { settings: any,
  settingsTarget: Indicator | XYSeries,
  type: "done",
  target: this }

Invoked when modal is closed/saved.

#initstarted

Param { settings: any,
  settingsTarget: Indicator | XYSeries,
  type: "initstarted",
  target: this }

Invoked when modal starts generating actual content.

It's a good place to modify settings.

#opened

Param { type: "opened",
  target: this }

Inherited from IModalEvents

There are 3 inherited items currently hidden from this list.