Namespace for CIQ.TableView creation–related properties and functions.
- Since:
-
8.1.0
Members
-
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
-
colSeparator :string
-
Character separator between columns in export
Type:
- string
- Since:
-
9.1.0
-
copyLabel :string
-
Label for the copy button on the table view toolbar.
Type:
- string
- Since:
-
8.1.0
-
downloadLabel :string
-
Label for the download button on the table view toolbar.
Type:
- string
- Since:
-
8.1.0
-
percentDecimalPlaces :number
-
Number of decimal places to display for percent formatted columns
Type:
- number
- Since:
-
8.1.0
Methods
-
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 stxCIQ.ChartEngine A reference to the chart engine that contains the chart for which the table view is created.
configobject <optional>
Configuration parameters.
Properties
Name Type Argument Default Description dateFormatterfunction <optional>
Formats table date fields.
valueFormatterfunction <optional>
Formats table values.
volumeFormatterfunction <optional>
Formats the table volume field.
fileNameFormatterfunction <optional>
Formats the name of the file that contains the downloaded table data.
minColumnWidthstring <optional>
"84px" The minimum width (including units) of the table columns. Note: The units can be any CSS unit acceptable by the CSS
calcfunction.- Since:
-
- 8.1.0
Returns:
- Type
- HTMLElement
-
createToolbar(stx [, config])
-
Creates the toolbar cover elements of the table view.
The toolbar contains buttons for copying and saving the table data and for displaying additional table columns.
Parameters:
Name Type Argument Description stxCIQ.ChartEngine A reference to the chart engine that contains the chart for which the table view is created.
configobject <optional>
Configuration parameters.
Properties
Name Type Argument Description fileNameFormatterfunction <optional>
Formats the name of the file that contains the downloaded table data.
- Since:
-
- 8.7.0
Returns:
toolbar Constructed toolbar container element.
- Type
- HTMLElement
-
dataToCsv(data, params)
-
Transforms the chart data into a character-separated values (CSV) file, including column headers.
Parameters:
Name Type Description dataArray.<object> The chart data.
paramsobject Configuration parameters.
Properties
Name Type Default Description colHeadersObject.<string, {label: string, cls: (string|undefined)}> The column headers as defined in TableViewBuilder.colHeaders.
colSeparatorstring "\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
-
dataToHtml(data, params)
-
Creates an HTML table containing the chart data and column headers (see TableViewBuilder.colHeaders).
Parameters:
Name Type Description dataArray.<object> The chart data.
paramsobject Configuration parameters.
Properties
Name Type Argument Description colHeadersObject.<string, {label: string, cls: (string|undefined)}> The column headers as defined in TableViewBuilder.colHeaders.
minColumnWidthstring <optional>
The minimum width of the table columns, including units. Note: The units can be any CSS unit acceptable by the CSS
calcfunction.- Since:
-
8.1.0
Returns:
A table containing the chart data and column headers.
- Type
- HTMLElement
-
downloadCsv(csvString, filename [, stx])
-
Downloads the table view as a character-separated values (CSV) file.
Parameters:
Name Type Argument Description csvStringstring The table view in the form of character-separated data.
filenamestring The name given to the download file.
stxCIQ.ChartEngine <optional>
The chart engine
- Since:
-
- 8.1.0
- 8.5.0 Added optional
stxparameter to aid in specifying document to download from.
-
getAdditionalColumnLabel(viewingAdditionalColumns)
-
Gets the label of the additional columns button on the table view toolbar.
Parameters:
Name Type Description viewingAdditionalColumnsboolean 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
-
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 stxCIQ.ChartEngine A reference to the chart engine that contains the chart over which the cover is placed.
paramsobject Configuration parameters.
Properties
Name Type Argument Description coverUIMaxWidthnumber <optional>
The width of the chart (in pixels) below which the cover element overlays the entire chart, including user interface elements.
coverContainerstring <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
-
getChartData(stx, params)
-
Extracts OHLC (open, high, low, close) data from the chart.
Parameters:
Name Type Description stxCIQ.ChartEngine A reference to the chart engine that contains the chart from which the data is extracted.
paramsobject Configuration parameters.
Properties
Name Type Argument Description dateFormatterfunction <optional>
Formats date fields.
valueFormatterfunction <optional>
Formats OHLC and other values.
percentFormatterfunction <optional>
Formats percent fields.
volumeFormatterfunction <optional>
Formats the volume field.
additionalDataFieldsArray.<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>
-
getColumnHeaders(stx)
-
Creates column header object
Parameters:
Name Type Description stxCIQ.ChartEngine A reference to the chart engine that contains the chart for which the column headers object is created.
- Since:
-
9.3.0
Returns:
Colum header object
-
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 paramsobject Function parameters.
Properties
Name Type Argument Description stxCIQ.ChartEngine Chart engine instance.
symbolstring An instrument symbol, which is used as the table title in the toolbar. Should be the symbol of the chart main series.
copyFnfunction <optional>
Event handler for selection of the copy control.
downloadFnfunction <optional>
Event handler for selection of the download control.
toggleAdditionalColumnsFnfunction <optional>
Event handler for selection of the additional column control.
closeFnfunction <optional>
Event handler for selection of the table view close (X) control.
- Since:
-
- 8.1.0
- 9.1.0 Removed unused parameter
viewAdditionalColumns, added parameterstx.
Returns:
The toolbar, containing title and controls.
- Type
- HTMLElement
-
getDateFormatter(stx)
-
Creates a function that formats table view date fields.
Parameters:
Name Type Description stxCIQ.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
-
getFilenameFormatter(stx)
-
Creates a function that creates and formats a file name from the chart symbol and table view data.
Parameters:
Name Type Description stxCIQ.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
-
getSeriesDataNames(stx)
-
Obtains the symbols of all comparison series that have data in the chart's visible data segment.
Parameters:
Name Type Description stxCIQ.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>
-
getStudyDataNames(stx)
-
Obtains the names of all studies that have data in the chart's visible data segment.
Parameters:
Name Type Description stxCIQ.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>
-
getValueFormatter(stx [, decimalPlaces])
-
Creates a function that formats table view value fields.
Parameters:
Name Type Argument Description stxCIQ.ChartEngine A reference to the chart engine that contains the chart for which the value fields are formatted.
decimalPlacesnumber <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
-
getVolumeFormatter(stx)
-
Creates a function that formats the table view volume field.
Parameters:
Name Type Description stxCIQ.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
