Namespace: TableViewBuilder

TableViewBuilder

Namespace for CIQ.TableView creation–related properties and functions.

Since:
  • 8.1.0

Members


<static> colHeaders :Object.<string, {label: string, cls: (string|undefined)}>

The column header configuration for the table view.

Can be used for rearranging the column order, removing columns, and updating labels.

Note: Adding new columns has no effect.

Type:
  • Object.<string, {label: string, cls: (string|undefined)}>
Since:
  • 8.1.0


<static> copyLabel :string

Label for the copy button on the table view toolbar.

Type:
  • string
Since:
  • 8.1.0


<static> downloadLabel :string

Label for the download button on the table view toolbar.

Type:
  • string
Since:
  • 8.1.0


<static> percentDecimalPlaces :number

Number of decimal places to display for percent formatted columns

Type:
  • number
Since:
  • 8.1.0

Methods


<static> createTable(stx [, config])

Creates a table view as an HTMLElement overlay over a chart container. The table view displays a snapshot of the visible chart data segment.

The overlay contains buttons for copying and saving the table data and for displaying additional table columns.

Parameters:
Name Type Argument Description
stx CIQ.ChartEngine

A reference to the chart engine that contains the chart for which the table view is created.

config object <optional>

Configuration parameters.

Properties
Name Type Argument Default Description
dateFormatter function <optional>

Formats table date fields.

valueFormatter function <optional>

Formats table values.

volumeFormatter function <optional>

Formats the table volume field.

fileNameFormatter function <optional>

Formats the name of the file that contains the downloaded table data.

minColumnWidth string <optional>
"84px"

The minimum width (including units) of the table columns. Note: The units can be any CSS unit acceptable by the CSS calc function.

Since:
  • 8.1.0

Returns:
Type
HTMLElement

<static> dataToCsv(data, params)

Transforms the chart data into a character-separated values (CSV) file, including column headers.

Parameters:
Name Type Description
data Array.<object>

The chart data.

params object

Configuration parameters.

Properties
Name Type Default Description
colHeaders Object.<string, {label: string, cls: (string|undefined)}>

The column headers as defined in TableViewBuilder.colHeaders.

colSeparator string "\t"

The column separator for the CSV format.

Since:
  • 8.1.0

Returns:

The column headers and chart data as a CSV file.

Type
string

<static> dataToHtml(data, params)

Creates an HTML table containing the chart data and column headers (see TableViewBuilder.colHeaders).

Parameters:
Name Type Description
data Array.<object>

The chart data.

params object

Configuration parameters.

Properties
Name Type Argument Description
colHeaders Object.<string, {label: string, cls: (string|undefined)}>

The column headers as defined in TableViewBuilder.colHeaders.

minColumnWidth string <optional>

The minimum width of the table columns, including units. Note: The units can be any CSS unit acceptable by the CSS calc function.

Since:
  • 8.1.0

Returns:

A table containing the chart data and column headers.

Type
HTMLElement

<static> downloadCsv(csvString, filename)

Downloads the table view as a character-separated values (CSV) file.

Parameters:
Name Type Description
csvString string

The table view in the form of character-separated data.

filename string

The name given to the download file.

Since:
  • 8.1.0


<static> getAdditionalColumnLabel(viewingAdditionalColumns)

Gets the label of the additional columns button on the table view toolbar.

Parameters:
Name Type Description
viewingAdditionalColumns boolean

If this parameter is true, the label should indicate additional table columns will be shown; if false, hidden.

Since:
  • 8.1.0

Returns:

The button label.

Type
string

<static> getChartCover(stx, params)

Creates and attaches an HTML container element to the DOM. The element covers the chart and contains the table view.

Parameters:
Name Type Description
stx CIQ.ChartEngine

A reference to the chart engine that contains the chart over which the cover is placed.

params object

Configuration parameters.

Properties
Name Type Argument Description
coverUIMaxWidth number <optional>

The width of the chart (in pixels) below which the cover element overlays the entire chart, including user interface elements.

coverContainer string <optional>

A CSS selector used to obtain the DOM element that serves as the parent element of the cover element; for example, ".chartContainer".

Since:
  • 8.1.0

Returns:

The cover element.

Type
HTMLElement

<static> getChartData(stx, params)

Extracts OHLC (open, high, low, close) data from the chart.

Parameters:
Name Type Description
stx CIQ.ChartEngine

A reference to the chart engine that contains the chart from which the data is extracted.

params object

Configuration parameters.

Properties
Name Type Argument Description
dateFormatter function <optional>

Formats date fields.

valueFormatter function <optional>

Formats OHLC and other values.

percentFormatter function <optional>

Formats percent fields.

volumeFormatter function <optional>

Formats the volume field.

additionalDataFields Array.<string> <optional>

An array of additional data field names for comparison series and study data.

Since:
  • 8.1.0

Returns:

The formatted chart data.

Type
Array.<object>

<static> getCoverToolbar(params)

Creates a toolbar containing the table title and controls used to copy and download the table data and add additional table columns.

Parameters:
Name Type Description
params object

Function parameters.

Properties
Name Type Argument Description
symbol string

An instrument symbol, which is used as the table title in the toolbar. Should be the symbol of the chart main series.

viewAdditionalColumns boolean

Toggle that specifies whether the label for the additional columns button should indicate that additional columns will be shown or hidden. If this parameter is true, the label indicates additional table columns will be shown; if false, hidden.

copyFn function <optional>

Event handler for selection of the copy control.

downloadFn function <optional>

Event handler for selection of the download control.

toggleAdditionalColumnsFn function <optional>

Event handler for selection of the additional column control.

closeFn function <optional>

Event handler for selection of the table view close (X) control.

Since:
  • 8.1.0

Returns:

The toolbar, containing title and controls.

Type
HTMLElement

<static> getDateFormatter(stx)

Creates a function that formats table view date fields.

Parameters:
Name Type Description
stx CIQ.ChartEngine

A reference to the chart engine that contains the chart for which the date fields are formatted.

Since:
  • 8.1.0

Returns:

A date formatter.

Type
function

<static> getFilenameFormatter(stx)

Creates a function that creates and formats a file name from the chart symbol and table view data.

Parameters:
Name Type Description
stx CIQ.ChartEngine

A reference to the chart engine that contains the chart whose symbol and data is included in the file name.

Since:
  • 8.1.0

Returns:

A function that creates and formats a file name.

Type
function

<static> getSeriesDataNames(stx)

Obtains the symbols of all comparison series that have data in the chart's visible data segment.

Parameters:
Name Type Description
stx CIQ.ChartEngine

A reference to the chart engine that contains the comparison series.

Since:
  • 8.1.0

Returns:

The names (symbols) of all comparison series that are in the visible portion of the chart.

Type
Array.<string>

<static> getStudyDataNames(stx)

Obtains the names of all studies that have data in the chart's visible data segment.

Parameters:
Name Type Description
stx CIQ.ChartEngine

A reference to the chart engine that contains the chart studies.

Since:
  • 8.1.0

Returns:

The names of all studies that are in the visible portion of the chart.

Type
Array.<string>

<static> getValueFormatter(stx [, decimalPlaces])

Creates a function that formats table view value fields.

Parameters:
Name Type Argument Description
stx CIQ.ChartEngine

A reference to the chart engine that contains the chart for which the value fields are formatted.

decimalPlaces number <optional>

Number of decimal places to use, overrides any auto-detection of decimal places in data.

Since:
  • 8.1.0

Returns:

A value formatter.

Type
function

<static> getVolumeFormatter(stx)

Creates a function that formats the table view volume field.

Parameters:
Name Type Description
stx CIQ.ChartEngine

A reference to the chart engine that contains the chart for which the volume field is formatted.

Since:
  • 8.1.0

Returns:

A volume field formatter.

Type
function