new Chart()
The Chart class contains a collection of methods used to instantiate and configure charts and the chart user interface.
The decisions on what to initiate and how it gets initiated are based on the provided configuration object and the availabilty of resources loaded in the CIQ namespace.
- Since:
-
7.5.0
Methods
-
breakpointSetter(uiContext)
-
Returns a setter that updates the responsive break point of the top node of the chart user interface context.
Parameters:
Name Type Description uiContext
CIQ.UI.Context The chart user interface context.
- Since:
-
7.5.0
Returns:
A function that sets the responsive break point of the UI context.
- Type
- function
-
chartAreaTopSetter(uiContext)
-
Returns a setter that updates the top position of the chart area (the HTML element that has the CSS class
ciq-chart-area
) based on the height of the plug-ins panel.Parameters:
Name Type Description uiContext
CIQ.UI.Context The chart user interface context.
- Since:
-
7.5.0
Returns:
A function that sets the top position of the chart area.
- Type
- function
-
chartPositionSetter(uiContext)
-
Returns a setter function that updates the size of the side navigation panel by positioning the chart container
div
.Parameters:
Name Type Description uiContext
CIQ.UI.Context The chart user interface context.
- Since:
-
7.5.0
Returns:
A function that sets the size of the side navigation panel.
- Type
- function
-
createChartAndUI( [params])
-
Creates the chart engine and user interface, including the UI context.
Parameters:
Name Type Argument Description params
Object <optional>
function parameters
Properties
Name Type Argument Description container
HTMLElement <optional>
The HTML element that hosts the user interface elements of the chart. The element is a
cq-context
element, or it contains acq-context
element or element with acq-context
attribute. The context element, in turn, contains a chart container element; that is, an element with classchartContainer
.config
Object <optional>
Configuration for the chart engine, UI elements, and plug-ins. See individual methods for configuration options.
- Since:
-
7.5.0
Returns:
- Type
- CIQ.UI.Context
-
getBreakpoint(width)
-
Maps numeric widths to responsive break types. Break types include small (
break-sm
), medium (break-md
), and large (break-lg
).Parameters:
Name Type Description width
Number The widht in pixels for which a break type is determined.
- Since:
-
7.5.0
Returns:
The break type, one of
break-sm
,break-md
, orbreak-lg
.- Type
- String
-
getKeystrokeHubSetter(uiContext, keystrokeHub)
-
Gets a callback that set the the active context of the keystroke hub based on the mouse pointer location.
When multiple charts are on a page, the chart with the mouse pointer over it responds to keyboard input, such as shortcuts or symbol entry.
Parameters:
Name Type Description uiContext
CIQ.UI.Context The chart user interface context.
keystrokeHub
CIQ.UI.KeystrokeHub A reference to the keystroke hub.
- Since:
-
7.5.0
Returns:
A callback that sets the active context of the keystroke hub.
- Type
- function
-
initColorPicker()
-
Creates and appends a cq-color-picker component to the document body if one is not already attached.
- Since:
-
7.5.0
-
initContainerListeners(uiContext)
-
Initializes the chart container size change listener, channel subscriptions, and the keystroke hub and its focus management (see CIQ.UI.KeystrokeHub).
Parameters:
Name Type Description uiContext
CIQ.UI.Context The chart user interface context.
- Since:
-
7.5.0
-
initDialogHandler(uiContext)
-
Subscribes to the dialog channel.
Creates an element for the requested dialog if one does not exist in the document scope. Opens the dialog in response to channel messages.
Parameters:
Name Type Description uiContext
CIQ.UI.Context The chart user interface context.
- Since:
-
7.5.0
-
initDrawingEditListeners(uiContext)
-
Creates a CIQ.UI.DrawingEdit helper and adds listeners to the helper. The listeners post messages in the drawing channel when drawing starts and ends.
Parameters:
Name Type Description uiContext
CIQ.UI.Context The chart user interface context.
- Since:
-
7.5.0
-
initDrawingTools(uiContext)
-
Subscribes to the drawing channel to manage drawing tool visibility based on channel messages.
Parameters:
Name Type Description uiContext
CIQ.UI.Context The chart user interface context.
- Since:
-
7.5.0
-
initEventMarkers(uiContext)
-
Initiates event marker functionality.
Parameters:
Name Type Description uiContext
CIQ.UI.Context The chart user interface context.
- Since:
-
7.5.0
-
initExtensions(params)
-
Installs add-ons and plug-ins.
Parameters:
Name Type Description params
object Properties
Name Type Argument Description stx
CIQ.ChartEngine <optional>
A reference to the chart engine.
uiContext
CIQ.UI.Context <optional>
The chart user interface context.
config
Object <optional>
Contains the chart configuration, which includes a list of add-ons and a list of plug-ins.
type
String <optional>
Type of extension, either "addOns" or "plugins".
- Since:
-
7.5.0
-
initKeystrokeHub(uiContext)
-
Attaches a CIQ.UI.KeystrokeHub to the
body
element to enable users to start typing anywhere on the page to activate the chart's symbol input box.Modify this method to use a different tag, such as a
div
, if this behavior is too broad for your implementation.Parameters:
Name Type Description uiContext
CIQ.UI.Context The chart user interface context.
- Since:
-
7.5.0
-
initLookup(uiContext)
-
Creates a symbol change filter and attaches it to the chart UI context and lookup containers.
Parameters:
Name Type Description uiContext
CIQ.UI.Context The chart user interface context.
- Since:
-
7.5.0
-
loadChart(uiContext)
-
Loads a chart with an initial symbol. When configured to restore the layout (which is the default), recreates the settings used in the previous session, including the last viewed symbol.
Parameters:
Name Type Description uiContext
CIQ.UI.Context The chart user interface context.
- Since:
-
7.5.0
-
notifySizeChanges(uiContext)
-
Event handler for chart container size changes. Posts messages in the
breakpoint
andcontainerSize
channels when the context container size has changed.Listening for container size changes in some browsers can be inefficient. This function improves notification efficiency by posting messages for specific changes, such as changes in responsive layout break points.
Parameters:
Name Type Description uiContext
CIQ.UI.Context The chart user interface context.
- Since:
-
7.5.0
-
sidenavSizeSetter(uiContext)
-
Returns a setter that updates the width of the side navigation panel by positioning the chart area (the HTML element that has the CSS class
ciq-chart-area
).Parameters:
Name Type Description uiContext
CIQ.UI.Context The chart user interface context.
- Since:
-
7.5.0
Returns:
A function that sets the size of the side navigation panel.
- Type
- function
-
sidepanelSizeSetter(uiContext)
-
Returns a setter that updates the width of the side panel by setting the right position of the chart area (the HTML element that has the CSS class
ciq-chart-area
) and the right margin of the Analyst Views plug-in,cq-analystviews
.Parameters:
Name Type Description uiContext
CIQ.UI.Context The chart user interface context.
- Since:
-
7.5.0
Returns:
A function that sets the width of the side panel.
- Type
- function