3.9.17.1HTML options

You add HTML to the chart using ChartChange() with command: "create-html". For example:

Framework.ChartChange({

mode: "active", // or "all", or "single" plus a .chartId value

command: "create-html",

options: {

foreground: true,

html: "<html><body>Hello!</body></html>"

}

});

(A second use of create-html replaces the previous HTML with the new HTML. You can only add a single HTML element to the chart.)

The options:{} which are passed alongside create-html can contain the following properties. You must provide either the html or url.

Property

Description

html

Text of the HTML to add; a complete document with <html> and </html> tags

url

URL of a web page to load. Standard browser security requires that this is hosted at a secure https:// address.

asDockItem

If true, loads your HTML into the chart's "dock" area (as used by the built-in Market Timer and Notepad indicators, for example). If not set, your HTML is loaded as an on-chart panel positioned using the style options.

dockTitle

Only applicable if asDockItem:true. Sets the title for the item in the dock area.

foreground

Not applicable if asDockItem is turned on. Controls whether the HTML is displayed in the background, behind the chart artifacts, or in the foreground. If your HTML includes elements for the user to interact with, such as buttons or fields, then you must set foreground:true.

style

Not applicable if asDockItem is turned on. Lets you set CSS style options on the iframe container, particularly the co-ordinates. For example:

style: {opacity: 0.5, pointerEvents: "none"}

You cannot set the CSS position, which is always absolute (within its container). You cannot set zIndex, which is instead controlled by the foreground option.