Class: ChartPanel

StockChartX. ChartPanel


new ChartPanel(config)

Describes chart panel.
Parameters:
Name Type Description
config Object The configuration object.
Properties
Name Type Argument Description
chartPanelsContainer StockChartX.ChartPanelsContainer The parent chart panels container.
minHeightRatio Number <optional>
The min allowed height ratio.
maxHeightRatio Number <optional>
The max allowed height ratio.
heightRatio Number <optional>
The height ratio.
moveDirection StockChartX.PanelMoveDirection <optional>
The allowed move direction.
moveKind StockChartX.PanelMoveKind <optional>
The move kind.

Extends

Members


<readonly> canvas :jQuery

Gets canvas element.
Type:
  • jQuery

<readonly> chart :StockChartX.Chart

Gets parent chart.
Type:

<readonly> chartPanelsContainer :StockChartX.ChartPanelsContainer

Gets parent chart panels container.
Type:

<readonly> contentFrame :StockChartX.Rect

Gets content frame rectangle.
Type:

<readonly> context :CanvasRenderingContext2D

Gets canvas rendering context.
Type:
  • CanvasRenderingContext2D

<readonly> drawings :Array.<StockChartX.Drawing>

Gets array of drawings on the panel.
Type:

formatter :StockChartX.IntlNumberFormat|StockChartX.CustomNumberFormat

Gets/Sets value formatter.
Type:

heightRatio :Number

Gets/Sets current height ratio. The value must be in range [minHeightRatio..maxHeightRatio].
Type:
  • Number

<readonly> indicators :Array.<StockChartX.Indicator>

Gets array of indicators on the chart panel.
Type:

maxHeightRatio :number

Gets/Sets maximum allowed height ratio. The value must be in range [minHeightRatio..1].
Type:
  • number

minHeightRatio :number

Gets/Sets minimum allowed height ratio. The value must be in range [0..maxHeightRatio].
Type:
  • number

moveDirection :StockChartX.PanelMoveDirection

Gets/Sets allowed move direction.
Type:

moveKind :StockChartX.PanelMoveKind

Gets/Sets panel's move kind.
Type:

<readonly> plots :Array.<StockChartX.Plot>

Gets array of plots on the panel.
Type:

<readonly> projection :StockChartX.Projection

Gets projection object to convert coordinates.
Type:

theme :object

Gets/Sets theme.
Type:
  • object

<readonly> titleDiv :jQuery

Gets title div element.
Type:
  • jQuery

<readonly> valueScale :StockChartX.ChartPanelValueScale

Gets value scale.
Type:

<readonly> valueScales :Array.<StockChartX.ChartPanelValueScale>

Gets array of value scales.
Type:

xGridVisible :boolean

Gets/Sets flag that indicates whether X grid is visible.
Type:
  • boolean

yGridVisible :boolean

Gets/Sets flag that indicates whether Y grid is visible.
Type:
  • boolean

Methods


addDrawings(drawings)

Adds drawings.
Parameters:
Name Type Description
drawings StockChartX.Drawing | Array.<StockChartX.Drawing> The drawing or an array of drawings to add.
See:

addPlot(plot)

Adds new plot.
Parameters:
Name Type Description
plot StockChartX.Plot | Array.<StockChartX.Plot> The plot or an array of plots to add.
See:

destroy()

Destroys chart panel (removes event subscriptions, html elements, etc.).
Overrides:

draw()

Draws control.
Inherited From:

formatValue(value)

Returns the string representation of a given value.
Parameters:
Name Type Description
value number The value.
Returns:
Type
string

get()

The actual theme.

getAutoScaledMinMaxValues(valueScale)

Returns min/max values for auto-scaling.
Parameters:
Name Type Argument Description
valueScale StockChartX.ChartValueScale <optional>
The value scale.
Returns:
Type
Object

getMinMaxValues(startIndex, count, valueScale)

Returns minimum and maximum plot's values.
Parameters:
Name Type Argument Description
startIndex number <optional>
The starting index of the range to search.
count number <optional>
The length of the range to search.
valueScale StockChartX.ValueScale <optional>
The value scale.
See:
Returns:
An object that contains min and max values.
Type
Object

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:

loadState(state)

Loads state.
Parameters:
Name Type Description
state object The state saved by saveState function.
See:

removeDrawings(drawings)

Removes one or more drawings.
Parameters:
Name Type Argument Description
drawings StockChartX.Drawing | Array.<StockChartX.Drawing> <optional>
The drawing or an array of drawings to remove. All drawings are removed if omitted.
See:

removePlot(plot)

Removes given plot or an array of plots.
Parameters:
Name Type Description
plot StockChartX.Plot | Array.<StockChartX.Plot> The plot or an array of plots to remove.
See:

saveState()

Saves state.
See:
Returns:
Type
object

setNeedsAutoScale()

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

update()

Layouts and draws chart panel.