Class: Projection

StockChartX. Projection


new Projection(dateScale, valueScale)

Represent projection. Converts records to pixels, pixels to records, etc...
Parameters:
Name Type Argument Description
dateScale StockChartX.DateScale <optional>
The corresponding date scale.
valueScale StockChartX.ChartPanelValueScale <optional>
The corresponding value scale.

Members


canResolveX :Boolean

Determines if X coordinate can be resolved. X coordinate can be resolved if date scale is specified.
Type:
  • Boolean
See:
  • canResolveY

<readonly> dateScale

Gets corresponding date scale.

<readonly> valueScale

Gets corresponding value scale.

Methods


columnByDate(date)

Returns column number by date value.
Parameters:
Name Type Description
date Date The date.
See:
Returns:
Type
number

columnByRecord(record, isIntegral)

Returns column number by record.
Parameters:
Name Type Argument Default Description
record Number The record.
isIntegral boolean <optional>
true The flag that indicates whether resulting column should be integral number.
See:
Returns:
Column number.
Type
number

columnByX(x, isIntegral)

Returns column number by X coordinate.
Parameters:
Name Type Argument Default Description
x Number The X coordinate.
isIntegral Boolean <optional>
true The flag that indicates whether resulting column should be an integral number.
See:
Returns:
Type
number

dateByColumn(column)

Returns date value by column number. It does not support float number columns.
Parameters:
Name Type Description
column Number The column number.
See:
Returns:
Type
Date

dateByRecord(record)

Returns date value by record number. It does not support float number records.
Parameters:
Name Type Description
record Number The record number
See:
Returns:
Type
Date

dateByX(x)

Returns date value by X coordinate.
Parameters:
Name Type Description
x Number The X coordinate.
See:
Returns:
Type
Date

recordByColumn(column, isIntegral)

Returns record index by column number.
Parameters:
Name Type Argument Default Description
column Number The column number.
isIntegral boolean <optional>
true The flag that indicates whether resulting record should be an integral number.
See:
Returns:
Type
Number

recordByDate(date)

Returns record number by date value.
Parameters:
Name Type Description
date Date The date.
See:
Returns:
Type
Number

recordByX(x, isIntegral)

Returns record number by X coordinate.
Parameters:
Name Type Argument Default Description
x Number The X coordinate
isIntegral Boolean <optional>
true The flag that indicates whether resulting record should be integral number.
See:
Returns:
Type
Number

valueByY(y)

Returns value by Y coordinate.
Parameters:
Name Type Description
y Number The Y coordinate.
See:
Returns:
Type
number

xByColumn(column, isColumnIntegral, isXIntegral)

Returns X coordinate by column number.
Parameters:
Name Type Argument Default Description
column Number The column number.
isColumnIntegral boolean <optional>
true If true then column is integral value and half-column width is added to the result. For internal use.
isXIntegral boolean <optional>
true The flag that indicates whether resulting X should be rounded to integral value.
See:
Returns:
X coordinate.
Type
number

xByDate(date, isIntegral)

Returns X coordinate by date value.
Parameters:
Name Type Argument Default Description
date Date The date.
isIntegral boolean <optional>
true The flag that indicates whether resulting x should be rounded to integral value.
See:
Returns:
Type
number

xByRecord(record, isIntegral, isXIntegral)

Returns X coordinate by record number.
Parameters:
Name Type Argument Default Description
record Number The record number.
isIntegral boolean <optional>
true For internal use.
isXIntegral boolean <optional>
true The flag that indicates whether resulting X should be rounded to integral value.
See:
Returns:
Type
number

yByValue(value)

Returns Y coordinate by value.
Parameters:
Name Type Description
value Number The value.
See:
Returns:
Type
number