Class: ChartPanelsContainer

StockChartX. ChartPanelsContainer


new ChartPanelsContainer(config)

Represents container for chart panels.
Parameters:
Name Type Description
config Object The configuration object.
Properties
Name Type Description
chart StockChartX.chart The parent chart.

Extends

Members


newPanelHeightRatio :Number

Gets/Sets default height ratio of new chart panels. The value must be in range (0..1).
Type:
  • Number
Default Value:
  • 0.2

<readonly> panels :Array.<StockChartX.ChartPanel>

Gets array of chart panels.
Type:

<readonly> panelsContentFrame :StockChartX.Rect

Gets panels content frame rectangle (excluding value scales).
Type:

Methods


addPanel(index, heightRatio, shrinkMainPanel)

Adds new chart panel.
Parameters:
Name Type Argument Description
index Number <optional>
The index to insert panel at.
heightRatio Number <optional>
The height ratio of new panel.
shrinkMainPanel Boolean <optional>
True to shrink main panel, false to shrink all panels.
See:
Throws:
An error is thrown on lack of free space.
Returns:
The newly created chart panel.
Type
StockChartX.ChartPanel

destroy()

Destroys and removes control from the parent element.
Inherited From:

draw()

Draws control.
Inherited From:

findPanelAt(y)

Gets chart panel at a given Y coordinate.
Parameters:
Name Type Description
y number The Y coordinate.
Returns:
Type
StockChartX.ChartPanel

handleEvent(event)

Handles event.
Parameters:
Name Type Description
event StockChartX.WindowEvent The event object.
Inherited From:
Returns:
Type
boolean

hitTest(point)

Checks if a given point belongs to a frame rectangle.
Parameters:
Name Type Description
point StockChartX.Point The point.
Inherited From:
Returns:
Type
boolean

layout(frame)

Layouts controls.
Parameters:
Name Type Description
frame StockChartX.Rect The frame rectangle related to parent container.
Inherited From:

layoutScalePanel(chartPanelsFrame)

Layouts chart panels container only.
Parameters:
Name Type Description
chartPanelsFrame StockChartX.Rect The chart panels container frame rectangle

loadState(state)

Loads state.
Parameters:
Name Type Description
state Array.<Object> The state saved by saveState method.
See:

movePanel(panel, offset)

Moves panel up/down.
Parameters:
Name Type Description
panel StockChartX.ChartPanel The panel to move.
offset number The panel index offset (positive number to move up, negative to move down).

removePanel(panel)

Removes given chart panel.
Parameters:
Name Type Description
panel number | StockChartX.ChartPanel The index of chart panel or chart panel object to be removed.
See:
Throws:
An error is thrown on attempt to remove main panel.

saveState()

Save all chart panels state.
See:
Returns:
Type
Array.<Object>

setNeedsAutoScale()

Marks that value scales needs to be auto-scaled on next layout.