Namespace: CIQ

CIQ

Base namespace for CIQ library

Previously STX

Classes

Animation
ChartEngine
Drawing
EaseMachine
ExtendedHours
InactivityTimer
Marker
Market
NameValueStore
Plotter
RangeSlider
Renderer
Share
ThemeHelper
Tooltip

Namespaces

Comparison
Extras
I18N
QuoteFeed
Studies
UI

Members


ipad

READ ONLY. Will be 'true' if the chart is running on an iPad


iphone

READ ONLY. Will be 'true' if the chart is running on an iPhone


is_chrome

READ ONLY. Will be 'true' if the chart is running on a Chrome browser


isAndroid

READ ONLY. Will be 'true' if the chart is running on an Android OS device


isIE

READ ONLY. Will be 'true' if the chart is running on a IE browser


isIE8

READ ONLY. Will be 'true' if the chart is running on a IE 8 browser


isIE9

READ ONLY. Will be 'true' if the chart is running on a IE 9 browser


isIOS7

READ ONLY. Will be 'true' if the chart is running on an iOS 7 device


isIOS7or8

READ ONLY. Will be 'true' if the chart is running on an IOS7, IOS8, IOS9 or IOS10 device


isIOS8

READ ONLY. Will be 'true' if the chart is running on an iOS 8 device


isIOS9

READ ONLY. Will be 'true' if the chart is running on an iOS 9 device


isIOS10

READ ONLY. Will be 'true' if the chart is running on an iOS 10 device


isMobile

READ ONLY. Will be 'true' if the chart is running on a mobile device ( CIQ.isAndroid, CIQ.ipad, or CIQ.iphone )


isSurface

READ ONLY. Will be 'true' if the chart is running on a MS Surface like device


isSurfaceApp

READ ONLY. Will be 'true' if the chart is running from a MS Surface application


noKeyboard

READ ONLY. Will be 'true' if the chart is running from a device with no Keyboard ( CIQ.ipad, CIQ.iphone, CIQ.isAndroid or CIQ.isSurfaceApp )


privateBrowsingAlert

Set once after user is alerted that private browsing is enabled


touchDevice

READ ONLY. Will be 'true' if the chart is running on a touch capable device

Methods


addMemberToMasterdata(params)

Convenience function to iterate through the charts masterData and add a data member. Generally used for additional comparison or study symbols. Can be used with any array of data objects which contains at least the 'DT' (date in javascript format) and 'Close' ( close/last price ) elements of an OHLC object. The data member will be the string defined by "label".

Parameters:
Name Type Description
params object

Parameters object

Properties
Name Type Argument Default Description
stx CIQ.ChartEngine <optional>

A chart object

data Array <optional>

The data to add (which should align or closely align with the chart data by date)

label string <optional>

The new member name to add to masterData. masterData[label]=data["Close"]. Required unless "fields" is specified.

fields Array <optional>

The fields from the incoming data objects to extract and add to the new label member (as opposed to using "Close"). One label member will be added per field. Takes precedence over createObject flag. Use fields=["*"] to copy all fields in the data object.

createObject Boolean <optional>

If true, then data elements from the data array are added as objects assigned to the label. Example: member[label]=data[element]; This behavior is mutually exclusive with fields.

fieldForLabel string <optional>
"Close"

If set, this will be the field from which data will be copied. If not set, "Close" is used; This behavior is mutually exclusive with fields.

fillGaps string <optional>

If set then gaps in data will be filled by carrying forward the last bar. Set to "carry" to carry the last value forward.

chart CIQ.ChartEngine.Chart <optional>

The chart to update

Since:

  • • 15-07-01 fieldForLabel argument
    • 3.0.0 all data sent in will be forced into the chart. Dates are no longer required to be exact matches (minutes, hours, seconds, milliseconds) in order to show up in comparisons.
    • 4.0.0 Arguments are now parameterized. Backward compatibility with old signature.
    • 4.0.0 Added ability to specify copying of all fields by setting params.fields=["*"]
Example
//data element format if neither fields nor createObject are used
{DT:epoch,Date:strDate,Close:value then Value:value}
//data element format if fields is used
{DT:epoch,Date:strDate,Field1:value,Field2:value,Field3:value,Field4:value}
//data element format if createObject is used
{DT:epoch,Date:strDate,AnyOtherData:otherData,MoreData:otherData,...}

addResizeListener(element, callback)

Attaches a callback to listen for resize events on the DOM.

Parameters:
Name Type Description
element node
callback function

alert(text)

User friendly alerts. The charting engine always uses this instead of alert() for warning or error messages. This method can be overriden as required by your user interface.

Parameters:
Name Type Description
text string

Alert message

Example
// Override with a friendlier alert mechanism!
CIQ.alert=function(text){
	doSomethingElse(text);
}

appendClassName(node, className)

Appends a class name to a node if it isn't already there. This is frequently used to control dynamic behavior via CSS.

Parameters:
Name Type Description
node object

A valid DOM element

className string

Name of class to add to the DOM element

Example
// Apply an "active" css look to an object
CIQ.appendClassName(myNode, "active");

borderPatternToArray( [width] [, pattern])

Convert a pattern type to an array useful for setting the context.setLineDash

Parameters:
Name Type Argument Default Description
width number <optional>
1

A valid lineWidth from 1

pattern string <optional>
solid

A valid pattern (solid, dotted, dashed)

Since:
  • 4.0.0
Returns:

The array representing pixels of draw/skip etc. Use it as argument to context.setLineDash()

Type
array

boxIntersects(bx1, by1, bx2, by2, x0, y0, x1, y1, vtype, isLog)

Determines whether a line intersects a box. This is used within the charting engine to determine whether the cursor has intersected a drawing.

Parameters:
Name Type Description
bx1 number
by1 number
bx2 number
by2 number
x0 number
y0 number
x1 number
y1 number
vtype string

Either "segment", "ray" or "line"

isLog boolean

True if the chart is in log scale and linear values are passed in

Since:
  • 4.0.0 `isLog` parameter added
Returns:

Returns true if the line intersects the box

Type
boolean

calculateHeikinAshi(stx, newData, computed)

Calculates Heikin-Ashi values. Takes some unaggregated data and returns aggregated data.

This method is used inside CIQ.ChartEngine#createDataSet to determine the data aggregation logic and should not be called directly. Use CIQ.ChartEngine#setAggregationType instead.

See the Chart types tutorial for details on how to override aggregation type defaults.

Parameters:
Name Type Description
stx CIQ.ChartEngine

The chart object

newData array

The data to aggregate. Normally the dataSet.

computed array

Cumulative computed records from last pass through this function. Used to increase performance by reusing pre-calculated bars and only calculate missing new bars.

Version:
  • ChartIQ Advanced Package
Since:
  • 3.0.0 computed parameter added
Returns:

The aggregated data

Type
array

calculateKagi(stx, newData, reversal, computed)

Calculates Kagi chart values. Takes some unaggregated data and returns aggregated data.

This method is used inside CIQ.ChartEngine#createDataSet to determine the data aggregation logic and should not be called directly. Use CIQ.ChartEngine#setAggregationType instead.

See the Chart types tutorial for details on how to override aggregation type defaults.

Parameters:
Name Type Description
stx CIQ.ChartEngine

The chart object

newData array

The data to aggregate. Normally the dataSet.

reversal number

The reversal percentage for the kagi lines. This is typically user configurable. Default is 4% for daily, .4% for intraday.

computed array

Cumulative computed records from last pass through this function. Used to increase performance by reusing pre-calculated bars and only calculate missing new bars.

Version:
  • ChartIQ Advanced Package
Since:
  • 3.0.0 computed parameter added
Returns:

The aggregated data

Type
array

calculateLineBreak(stx, newData, pricelines, computed)

Calculates Line Break chart values. Takes some unaggregated data and returns aggregated data.

This method is used inside CIQ.ChartEngine#createDataSet to determine the data aggregation logic and should not be called directly. Use CIQ.ChartEngine#setAggregationType instead.

See the Chart types tutorial for details on how to override aggregation type defaults.

Parameters:
Name Type Description
stx CIQ.ChartEngine

The chart object

newData array

The data to aggregate. Normally the dataSet.

pricelines number

The number of lines to use for the line break count. This is typically user configurable. Default is 3.

computed array

Cumulative computed records from last pass through this function. Used to increase performance by reusing pre-calculated bars and only calculate missing new bars.

Version:
  • ChartIQ Advanced Package
Since:
  • 3.0.0 computed parameter added
Returns:

The aggregated data

Type
array

calculatePointFigure(stx, newData, pandf, computed)

Calculates Point and Figure (P&F) chart values. Takes some unaggregated data and returns aggregated data.

This method is used inside CIQ.ChartEngine#createDataSet to determine the data aggregation logic and should not be called directly. Use CIQ.ChartEngine#setAggregationType instead.

See the Chart types tutorial for details on how to override aggregation type defaults.

Parameters:
Name Type Description
stx CIQ.ChartEngine

The chart object

newData array

The data to aggregate. Normally the dataSet.

pandf object

The parameters for point and figure.

Properties
Name Type Argument Description
box number <optional>

The box size. Default is automatically determined based on the price.

reversal number <optional>

The reversal amount, in boxes. Default is 3.

computed array

Cumulative computed records from last pass through this function. Used to increase performance by reusing pre-calculated bars and only calculate missing new bars.

Version:
  • ChartIQ Advanced Package
Since:
  • 3.0.0 computed parameter added
Returns:

The aggregated data

Type
array

calculateRangeBars(stx, newData, range, computed)

Calculates range bars. Takes some unaggregated data and returns aggregated data.

This method is used inside CIQ.ChartEngine#createDataSet to determine the data aggregation logic and should not be called directly. Use CIQ.ChartEngine#setAggregationType instead.

See the Chart types tutorial for details on how to override aggregation type defaults.

Parameters:
Name Type Description
stx CIQ.ChartEngine

The chart object

newData array

The data to aggregate. Normally the dataSet.

range number

The price range for the range bars. This is typically user configurable. Defaults to a ramge size so that about 300 bars worth of time are displayed; about a year for a daily chart, about 5 hours on a minute chart.

computed array

Cumulative computed records from last pass through this function. Used to increase performance by reusing pre-calculated bars and only calculate missing new bars.

Version:
  • ChartIQ Advanced Package
Since:
  • 3.0.0 computed parameter added
Returns:

The aggregated data

Type
array

calculateRenkoBars(stx, newData, range, computed)

Calculates Renko bars. Takes some unaggregated data and returns aggregated data.

This method is used inside CIQ.ChartEngine#createDataSet to determine the data aggregation logic and should not be called directly. Use CIQ.ChartEngine#setAggregationType instead.

Renko bars use Close method only, not High/Low or ATR

See the Chart types tutorial for details on how to override aggregation type defaults.

Parameters:
Name Type Description
stx CIQ.ChartEngine

The chart object

newData array

The data to aggregate. Normally the dataSet.

range number

The brick size for the renko bars. This is typically user configurable. Defaults to a brick size so that about 300 bars worth of time are displayed; about a year for a daily chart, about 5 hours on a minute chart.

computed array

Cumulative computed records from last pass through this function. Used to increase performance by reusing pre-calculated bars and only calculate missing new bars.

Version:
  • ChartIQ Advanced Package
Since:
  • 3.0.0 computed parameter added
Returns:

The aggregated data

Type
array

calculateTradingDecimalPlaces(params)

Determines how many decimal places the security trades. This is a callback from CIQ.ChartEngine.calculateTradingDecimalPlaces and you can override this with your own functionality. The default algorithm is to check the most recent 50 quotes and find the maximum number of decimal places that the stock has traded. This will work for most securities but if your market data feed has rounding errors or bad data then you may want to supplement this algorithm that checks the maximum value by security type.

Parameters:
Name Type Description
params Object

Parameters

Properties
Name Type Description
stx CIQ.ChartEngine

The chart object

chart CIQ.ChartEngine.Chart

The chart in question

symbol Object

The symbol object. If you create charts with just stock symbol then symbolObject.symbol will contain that symbol

Returns:

The number of decimal places

Type
Number

chooseForegroundColor(backgroundColor)

Chooses either a white or black foreground color depending on the "lightness" of the background color. Note that this simply checks if the value is above .5 which works well but not ideally for red colors which the human eye interprets differently. More complex algorithms are available but chartists rarely use red as a background color.

Parameters:
Name Type Description
backgroundColor string

The background color (CSS format)

Returns:

Either #000000 (black) or #FFFFFF (white) depending on will look best on the given background color

Type
string

clearCanvas(canvas [, stx])

Animation Loop Clears the canvas. Uses the fastest known method except on the legacy Android browser which had many problems!

Parameters:
Name Type Argument Description
canvas object

A valid HTML canvas object

stx object <optional>

A chart object, only necessary for old Android browsers on problematic devices


clearNode(node)

Removes all DOM elements in a given node. This is extremely useful when dynamically generating content.

Parameters:
Name Type Description
node object

The node to clear


clearSafeClickTouches(div)

Clears all safeClickTouch events from a DOM element.

Parameters:
Name Type Description
div object

The DOM element to clear events


clone(from [, to])

Clones an object. This function creates a deep (recursive) clone of an object. The object can be a primitive or an object or an array. Note that cloning objects that reference DOM nodes can result in stack overflows. Use with caution.

Parameters:
Name Type Argument Description
from object

The source object

to object <optional>

Optional existing object of same type. Can improve performance when objects are reusable.

Returns:

A deep clone of the "from" object

Type
object

colorsEqual(color1, color2)

Checks if two colors are the same. Will compare alpha channel is provided as well.

Parameters:
Name Type Description
color1 string

First color, in rgb, rgba, css hex, or literal format

color2 string

Second color, in rgb, rgba, css hex, or literal format

Since:
  • 4.0.0
Returns:

true if equivalent

Type
boolean
Example
var isSame=CIQ.colorsEqual("rgba (255,255,255,0.3)", "#FFFFFF");
		returns false
var isSame=CIQ.colorsEqual("rgba (255,255,255,1)", "#FFFFFF");
		returns true

colorToHex(color)

Converts an rgb or rgba color to a hex color

Parameters:
Name Type Description
color string

The rgb or rgba color, such as in CSS format

Since:
  • 4.0.0 Converts 3 char hex (#FFC) to six characters (#FFFFCC)
Returns:

The hex color. If "transparent" or no color is sent in, #000000 will be assumed

Type
string
Example
var hexColor=CIQ.colorToHex("rgba (255,255,255,0.3)");

commas(val)

Returns a string representation of a number with commas in thousands, millions or billions places. Note that this function does not handle values with more than 3 decimal places!!!

Parameters:
Name Type Description
val number

The value

Returns:

The result with commas

Type
string
Example
// Returns 1,000,000
CIQ.commas(1000000);

computeEquationChart(equation, map)

Computes an equation that may contain symbols and simple arithmetic operators. Parentheses can be used to separate portions of the equation. PEMDAS priority is observed. Symbols can be optionally contained within brackets. Valid examples: 3IBM, 4+(IBM2), (IBM-GM)/2 If the equation cannot be resolved an exception is thrown.

Parameters:
Name Type Description
equation string

The equation to compute.

map Object

An map of symbols to data

Version:
  • ChartIQ Advanced Package
Returns:

A consolidated array of equation results

Type
Array

condenseInt(txt)

Condenses a number into abbreviated form by adding "k","m","b" or "t". This method is used in the y-axis for example with volume studies.

Parameters:
Name Type Description
txt number

A numerical value

Since:
  • 4.0.0 now returns `txt` untouched if under 1000. Previously was removing all decimal places.
Returns:

Condensed version of the number if over 999, otherwise returnes txt untouched

Type
string
Example
// This will return 12m
condentInt(12000000);

convertClickToTouchEnd(id)

Converts an onClick event to an ontouchend event. If the device is known to be a touch device then this can be used to change onclick events that are set as attributes (in HTML). ontouchend events are more responsive than onclick events and can improve the user experience. When coding for cross-device implementations it is recommended to use @see CIQ.safeClickTouch programatically rather than using hardcoded attributes

Parameters:
Name Type Description
id string

The id of a node containing an onClick attribute


convertCurrencyCode(code)

Converts a currency code from ISO to char

Parameters:
Name Type Description
code string

The string to convert, e.g. USD

Returns:

The converted string, e.g. $

Type
string

convertFutureMonth(x)

Converts a future month to the month index or vice versa. Month indexes begin with 1 for January

Parameters:
Name Type Description
x char

The value to convert. If numeric, will convert to Future month letter. If Alpha, will convert to month index.

Returns:

Converted value

Type
char

convertTimeZone(dt, originalTimeZone, targetTimeZone)

Converts a Date object from one time zone to another using the timezoneJS.Date library

Parameters:
Name Type Description
dt Date

Original JavaScript Date object, from the original time zone

originalTimeZone string

The original time zone

targetTimeZone string

The target time zone

Returns:

The date in the target timezone. This behaves the same as a native Date.

Type
timezoneJS.Date

convertToLocalTime(dt, originalTimeZone)

This method converts a time from another timezone to local time on the browser

Parameters:
Name Type Description
dt Date

The original time

originalTimeZone string

A valid timezone

Returns:

The date converted to local time

Type
Date

createLabel(params)

Creates a text label on the canvas.

Parameters:
Name Type Description
params object
Properties
Name Type Description
ctx object

A valid HTML Canvas Context

x number

Left position of drawing on canvas

txt number

Text for the lavel

y number

Y position of drawing on canvas

margin object

Margin around the text

Properties
Name Type Description
left object

Left margin of text

top object

Top margin of text

backgroundColor number

background color. This is used to find the text color if there is no color specified

color number

Text color

Since:
  • 3.0.0 - New Function

derivedFrom(child, parent)

Replacement for isPrototypeOf and instanceof so that both types of inheritance can be checked

Parameters:
Name Type Description
child object

The object instance to check

parent object

Prototype

Since:
  • 07/01/2015
Returns:

True if the object is derived from the parent

Type
boolean

deriveFromObjectChain(base, extension)

Given a dot notation string, we want to navigate to the location in a base object, creating the path along the way

Parameters:
Name Type Description
base object

Base object.

extension string

String in dot notation

Since:
  • 2015-11-1
Returns:

A tuple containing obj and member

Type
object
Example
var tuple=CIQ.deriveFromObjectChain(stx.layout, "pandf.box");
tuple.obj===stx.layout.pandf
tuble.member==="box"
tuple.obj[tuple.member]=3;  // stx.layout.pandf.box=3

destroy(stx, excludedSelector)

Convenience function to destruct a chart window and related GUI; eliminating all instanticated web components, references and dependencies, and optionally its containing DOM element.

Please note that this method will destroy the menu manager and theme manager, when present, even if multiple charts are registered to them. In which case you must manually call the destroy() method for the remaining charts.

To destroy just the chart container see CIQ.ChartEngine#destroy

Parameters:
Name Type Description
stx CIQ.ChartEngine

The chart object to destroy

excludedSelector string

If passed then any top level object within chartContainer which matches this selector will not be deleted (and neither will the wrapper)

Since:
  • 07/01/2015

displayableDate(stx, chart, dt)

Displays a date according to the chart settings. It will format the date according to the folllowing order:

  1. xAxis formatter
  2. Internationalization
  3. default
     a. Daily: mm-dd-yyyy
     b. Intraday: mm/dd hh:mm[:ss[:ms]]
Parameters:
Name Type Description
stx CIQ.ChartEngine

The charting object

chart CIQ.ChartEngine.Chart

The specific chart

dt date

JavaScript date

Since:
  • 4.0.0
Returns:

Formatted date

Type
string

drawLegend(stx, params)

Draws a legend for the series that are displayed on the chart.

Parameters:
Name Type Description
stx CIQ.ChartEngine

The chart object to draw

params object

parameters for drawing the legend

Properties
Name Type Argument Description
chart CIQ.ChartEngine.Chart <optional>

The chart object

legendColorMap object <optional>

A map of series names to colors and display symbols ( example IBM:{color:'red', display:'Int B M'} )

coordinates object <optional>

Coordinates upon which to draw the items, in pixels relative to top left of panel ( example {x:50, y:0} ). If null, uses chart.legend

noBase boolean <optional>

Set to true to not draw the base (the chart symbol's color) in the legend


drawLegendItem(stx, xy, label, color)

Draws an item in the legend and returns the position for the next item

Parameters:
Name Type Description
stx CIQ.ChartEngine

The chart object

xy array

An X,Y tuple (from chart.legend)

label string

The text to print in the item

color string

The color for the background of the item

Returns:

A tuple containing the X,Y position for the next the item

Type
array

extend(target, source [, shallow])

Extends an object, similar to jquery.extend() with a deep copy

Parameters:
Name Type Argument Description
target object

Target object

source object

Original object

shallow boolean <optional>

If true then extend will not recurse through objects

Returns:

Target object after extension

Type
object

fetchEquationChart(params, cb)

Extracts symbols from an equation and fetches the quotes for them.

Parameters:
Name Type Description
params object

Parameters used for the fetch

cb function

Callback function once all quotes are fetched

Version:
  • ChartIQ Advanced Package

fillArea(stx, points, params)

Fills an area on the chart, usually created by a study.

Parameters:
Name Type Description
stx CIQ.ChartEngine

The chart object

points array

The set of points, this is an array of chart coordinates in array form e.g. [[x1,y1],[x2,y2]]. The points should be arranged to form a loop; the loop need not be closed.

params object

parameters

Properties
Name Type Argument Description
color string <optional>

color to fill the area

opacity number <optional>

opacity of fill, 0 to 1. Defaults to 0.1

tension number <optional>

tension for splining

panelName string <optional>

optional Name of panel to draw on. If omitted or invalid, area may fill over top or bottom of plot area

Since:

  • • 01-2015-20 `params.panelName` added
    • 4.0.0 Combined arguments into params, added tension

fillIntersecting(stx, panelName, parameters)

Fills an area on the chart delimited by intersecting bands.

Bands can be anchored by different y-axis as determined by the parameters.topAxis and parameters.bottomAxis parameters.

Parameters:
Name Type Description
stx CIQ.ChartEngine

The chart object

panelName string

The name of the panel

parameters object

The configuration parameters

Properties
Name Type Description
topBand string

The name of the quote field to use as the top band

bottomBand string

The name of the quote field to use as the bottom band

topColor string

The color of the top band, used to fill in a cloud whose top edge is the topBand

bottomColor string

The color the bottom band, used to fill in a cloud whose top edge is the bottomBand

topAxis CIQ.ChartEngine.YAxis

The y-axis for the top band (will use default axis if not specified)

bottomAxis CIQ.ChartEngine.YAxis

The y-axis for the bottom band (will use default axis if not specified)

skipTransform boolean

If true then any transformations (such as comparison charting) will not be applied

opacity number

The color opacity/transparency as a decimal number (1= full opacity / no transparency). Default is 0.3.

Since:
  • 4.1.2 Removed quotes argument; function always uses dataSegment.
Example
var parameters={
			topBand: "Leading Span A " + sd.name,
			bottomBand: "Leading Span B " + sd.name,
			topColor: "green",
			bottomColor: "red"
		};
		CIQ.fillIntersecting(stx, sd.panel, parameters)

fillTransparentCanvas(context, color, width, height)

Sets the transparent parts of the canvas to the specified background color. Used to ensure a background when turning charts into images because normally the background is the background of the DIV container and not the canvas itself.

Parameters:
Name Type Description
context object

An HTML canvas context

color string

The color to set the background. Any valid HTML canvas color.

width number

Width to apply color (Could be less than size of canvas)

height number

Height to apply color (Could be less than size of canvas if applying branding for instance)


findNodesByText(startNode, text)

Find all nodes that match the given text. This is a recursive function so be careful not to start too high in the DOM tree.

Parameters:
Name Type Description
startNode object

A valid DOM element from which to start looking

text string

The text to search for

Returns:

An array of nodes that match the text

Type
array

first(o)

Convenience function returns the first property in an object. Note that while this works in all known browsers the EMCA spec does not guarantee that the order of members in an object remain static. This method should therefore be avoided. When ordering is important use an Array!

Parameters:
Name Type Description
o object

A JavaSCript object

Returns:

The first element in the object or null if it is empty

Type
object

fixPrice(price)

Given a numeric price that may be a float with rounding errors, this will trim off the trailing zeroes

Parameters:
Name Type Description
price Float

The price

Returns:

The price trimmed of trailing zeroes

Type
Float

fixScreen()

Fixes screen scroll. This can occur when the keyboard opens on an ipad or iphone.


focus(node, useTimeout)

Microsoft surface bug requires a timeout in oreder for the cursor to show up in a focused text box. iPad also, sometimes, when embedded in an iframe, so set useTimeout if in an iframe!

Parameters:
Name Type Description
node object

A DOM element to focus

useTimeout number

Whether to apply a timeout or not. If number then the number of milliseconds.


formatEquation(equation)

Extracts symbols from an equation. An equation can consist of symbols and the following operators: +-/*%() PEMDAS order is followed. Additionally, symbols can be enclosed in brackets [] to treat them as literal non-parseables.

Parameters:
Name Type Description
equation string

The equation to parse (e.g. IBM+GE)

Version:
  • ChartIQ Advanced Package
Returns:

Parsed equation, {equation: [formatted equation], symbols: [array of symbols found in the equation]}

Type
object

friendlyDate(dt)

Converts a date into yyyy/mm/dd hh:mm format

Parameters:
Name Type Description
dt date

A JavaScript Date object

Returns:

Date in yyyy/mm/dd hh:mm format

Type
string

fromET(est)

Converts a JavaScript date from Eastern Time Zone to the browser's local time zone. Daylight Savings Time is hard coded. @see CIQ.getETDateTime

Parameters:
Name Type Description
est date

JavaScript Date object representing a date/time in eastern time zone

Returns:

JavaScript Date object converted to browser's local time zone

Type
date

getAjaxServer(url)

Gets an Ajax server dependent on browser method. If IE9 and a cross domain request then XDomainRequest() will be used rather than XMLHttpRequest.

Parameters:
Name Type Description
url string

The url to connect with

Returns:

An ajax server

Type
object

getETDateTime()

Gets the current time in Eastern Time Zone. This can be used as a convenience for determining open and closing times of US markets.

Returns:

JavaScript Date representing the time in Eastern Time Zone

Type
date

getEventDOM( [e])

Get the source element for a DOM event depending on browser type

Parameters:
Name Type Argument Description
e object <optional>

Event if available from browser

Returns:

The DOM node that registered the event

Type
object

getHostName(url)

Returns the host portion of a url

Parameters:
Name Type Description
url string

The url, such as document.location.href

Returns:

The host portion, including port, if the url is a valid URI

Type
string

getLines(ctx, phrase, l)

Turns a portion of raw text into multi-line text that fits in a given width. This is used for autoformatting of annotations

Parameters:
Name Type Description
ctx object

A valid HTML Canvas Context

phrase string

The text

l number

The width in pixels to fit the text within on the canvas

Returns:

An array of individual lines that should fit within the specified width

Type
array

getYearDay( [dt])

Gets the day of the year

Parameters:
Name Type Argument Description
dt Date <optional>

optional The date to check. If omitted, will use the current date.

Returns:

Day of year

Type
number

hasClassName(node, className)

Returns true if a class name is currently assigned to the DOM node

Parameters:
Name Type Description
node object

A valid DOM element

className string

The class name to search for

Returns:

True if the class name is currently assigned to the DOM node

Type
boolean

hexToRgba(color, opacity)

Converts color to rgba. This does not accept literal color names such as "black"

Parameters:
Name Type Description
color string

The hex rgb or rgba color, such as in CSS format

opacity number

The 'alpha' value. Defaults to full opacity (100%)

Returns:

The rgba color

Type
string
Example
var rgba=CIQ.hexToRgba('rgb(0, 115, 186)');
var rgba=CIQ.hexToRgba('#0073BA');

hideByText(startNode, text)

Hide nodes that match a certain text string.

Parameters:
Name Type Description
startNode object

A valid DOM element from which to start looking

text string

The text to match against CIQ.findNodesByText


hideKeyboard(newFocus)

Closes the keyboard on a touch device by blurring any active input elements.

Parameters:
Name Type Description
newFocus HTMLElement

optional element to change focus to


hsv(color)

Converts a color from hex or rgb format to Hue, Saturation, Value. This does not accept literal color names such as "black"

Parameters:
Name Type Description
color string

The color (from CSS)

Returns:

[Hue, Saturation, Value], or null if invalid color.

Type
array

innerHTML(node, html)

Microsoft RT disallows innerHTML that contains DOM elements. Use this method to override when necessary.

Parameters:
Name Type Description
node object

A valid DOM element to change innerHTML

html string

The html text to change

Example
CIQ.innerHTML(node, "My innerHTML contains <span>a span</span> and MS RT doesn't like that");

inputKeyEvents(node, cb)

Captures enter key events. Also clears the input box on escape key.

Parameters:
Name Type Description
node object

The DOM element to attach the event to. Should be a text input box.

cb function

Callback function when enter key is pressed.


intersectLineLineX()

Get the X intersection point between two lines


intersectLineLineY()

Get the Y intersection point between two lines


isDST( [dt])

DST checker. Returns whether input date is in DST

Parameters:
Name Type Argument Description
dt Date <optional>

optional The date to check. If omitted, will use the current date.

Returns:

True for DST, false for not.

Type
boolean

isEmpty(o)

Returns true if an object has no members

Parameters:
Name Type Description
o object

A JavaScript object

Returns:

True if there are no members in the object

Type
boolean

isTransparent(color)

Returns true if the color is transparent. In particular it checks rgba status. Note that the charting engine often interprets transparent colors to mean that a color should be automatically determined based on the brightness of the background.

Parameters:
Name Type Description
color string

The color (from CSS)

Returns:

True if transparent

Type
boolean

last(o)

Convenience function for returning the last property in an object. Note that while this works in all known browsers the EMCA spec does not guarantee that the order of members in an object remain static. This method should therefore be avoiding. When ordering is important use an Array!

Parameters:
Name Type Description
o object

A JavaScript object

Returns:

The final member of the object or null if the object is empty

Type
object

linesIntersect(x1, x2, y1, y2, x3, x4, y3, y4, type)

Determines whether two lines intersect

Parameters:
Name Type Description
x1 number
x2 number
y1 number
y2 number
x3 number
x4 number
y3 number
y4 number
type string

Either "segment", "ray" or "line"

Returns:

Returns true if the two lines intersect

Type
boolean

loadScript(scriptName, cb)

Loads JavaScript dynamically. This method keeps a static memory of scripts that have been loaded to prevent them from being loaded twice. The callback function however is always called, even if the script has already been loaded.

Parameters:
Name Type Description
scriptName string

The url of the script to load

cb function

Callback function to call when the script is loaded


loadStylesheet(stylesheet, cb)

Loads a stylesheet.

Parameters:
Name Type Description
stylesheet string

Name of stylesheet file.

cb function

Function to call when the stylesheet is fully loaded

Since:
  • 2016-03-11

loadUI(url, cb)

Dynamically load UI elements from an external HTML file. This is accomplished by rendering raw HTML in an iframe and then cloning all of the newly created DOM elements into our main document. The iframe is then removed.

The title of the iframe is checked. External content should not have a title. By convention, 404 or 500 errors have a title and so we use this to determine whether the iframe contains valid content or not.

Parameters:
Name Type Description
url string

The external url to fetch new UI content

cb function

A callback function to call when the new UI is available


loadWidget(widget, cb)

Loads a feature function widget. Feature function widgets consist of a css file, a JS file and an HTML file. This can be used to dynamically load content and functionality.

Parameters:
Name Type Description
widget string

Name of widget. The js, css and html files should be this name.

cb function

Function to call when the widget is fully loaded


localStorageSetItem(name, value)

Convenience function for storing a name value pair in local storage. This will detect if private browsing is enabled because localStorage is inoperable under private browsing

Parameters:
Name Type Description
name string

Name to store

value string

Value to store


log10(y)

Returns the log base 10 of a value

Parameters:
Name Type Description
y number

The value

Returns:

log10 value

Type
number

makeCamelCase(name)

Converts from hyphenated to camel case. Used primarily for converting css style names (which are hyphenated) to property values (which are camel case)

Parameters:
Name Type Description
name string

Hyphenated style name

Returns:

Camel case style name

Type
string

minMax(series, field)

This method will return an tuple [min,max] that contains the minimum and maximum values in the series where values are series[field]

Parameters:
Name Type Description
series Array

The series

field string

The name of the field to look at

Returns:

Tuple containing min and max values in the series

Type
Array

mmddhhmm(strdt)

Converts a string form date into mm-dd hh:mm format

Parameters:
Name Type Description
strdt string

Date in string format (such as yyyymmddhhmm, yyyy-mm-dd hh:mm, etc)

Returns:

Date in mm-dd hh:mm format

Type
string

mmddyyyy(dt)

Converts a JavaScript Date or string form date to mm/dd/yyyy format

Parameters:
Name Type Description
dt string

Date in JavaScript Date or string format such as YYYY-MM-DD

Since:
  • 2016-07-16
Returns:

Date in mm/dd/yyyy format

Type
string

money(val [, decimals] [, currency])

Prints out a number in US Dollar monetary representation

Parameters:
Name Type Argument Default Description
val number

The amount

decimals number <optional>
2

Optional number of decimal places.

currency string <optional>

Optional currency designation. If omitted, will use $.

Returns:

US Dollar monetary representation // Returns $100.00 CIQ.money(100, 2);

Type
string

monthAsDisplay(i, displayLetters [, stx])

Convenience function for creating a displayable month name using CIQ.monthLetters and CIQ.monthAbv. Please note that those arrays may not be utilized if the library is used in conjunction with Internationalization. This method is used primarily to create the x-axis of a chart

Parameters:
Name Type Argument Description
i number

The numerical month (0-11)

displayLetters boolean

True if just the first letter should be displayed (such as a tight display)

stx object <optional>

The chart object, only necessary if Internationalization is in use

Returns:

String representation of the month

Type
string

newChild(div, tagName [, className] [, txt])

Convenience function for dynamically creating a new node and appending it into the DOM.

Parameters:
Name Type Argument Description
div object

The targeted parent node

tagName string

The type of node to be created

className string <optional>

Optional class name to set the new node

txt string <optional>

Optional text to insert

Returns:

The new node

Type
object

noop()

No operation will be performed. As a result there will be no label drawn around the value. see CIQ.roundRect

Since:
  • 3.0.0 - function signature changed: This function now takes a params object instead of 8 different parameters

objLength(o)

Returns the number of members in an object

Parameters:
Name Type Description
o object

A valid JavaScript object

Returns:

The number of members in the object

Type
number

pageHeight()

Returns the height of the page. It is aware of iframes and so will never return a value that is greater than the value of the parent

Returns:

Height of page in pixels

Type
number

pageWidth()

Returns the width of the page. It is aware of iframes and so will never return a value that is greater than the value of the parent

Returns:

Width of page in pixels

Type
number

postAjax(params, arg1, arg2, arg3, arg4)

Convenience function for making an ajax post. If payload is non-null then the method will be set to POST, otherwise GET. Cross origin ajax is support on IE9.

Parameters:
Name Type Description
params object

Parameters for the post

Properties
Name Type Argument Description
url string <optional>

The url to send the ajax query to

payload string <optional>

An optional payload to send

cb CIQ.postAjax~requestCallback <optional>

Callback function when complete

contentType string <optional>

Optionally override the content type

noEpoch boolean <optional>

By default the epoch is appended as a query string to bust caching. Set this to false to not append the epoch.

method string <optional>

Optionally override the HTTP method

headers array <optional>

Optional additional HTTP headers to send

responseHeaders boolean <optional>

Optional Set to true to have callback passed the response headers from the server

timeout number <optional>

Optional Request timeout in msec. If omitted, timeout is default (no timeout)

ungovernable boolean <optional>

Optional If true, request not subject to rate limiting

arg1 string

Payload

arg2 function

Callback

arg3 string

Ajax content type

arg4 boolean

Set to true for no epoch

Since:
  • 3.0.0 Added timeout and ungovernable params
Returns:

True if there were no errors fetching data.

Type
true

prepareChannelFill(stx, parameters)

Fills an area on the chart delimited by non intersecting top and bottom bands (channel), usually created by a study.

Parameters:
Name Type Description
stx CIQ.ChartEngine

The chart object

parameters object

The configuration parameters

Properties
Name Type Description
panelName string

The name of the panel

noSlopes boolean

If set then chart will fill rectangles with no transition lines between levels

topBand string

The name of the quote field to use as the top band

bottomBand string

The name of the quote field to use as the bottom band

opacity integer

The color opacity/transparency as a decimal number (1= full opacity / no transparency)

color string

The fill color

Since:
  • 4.1.2 Removed quotes argument; function always uses dataSegment.
Example
CIQ.prepareChannelFill(stx,{"color":dngradient,"opacity":1,"panelName":sd.name,"topBand":"Zero "+sd.name,"bottomBand":"Under "+sd.name});

preparePeakValleyFill(stx, parameters)

Fills an area on the chart delimited by a series line closed off by a horizontal threshold line, usually created by a study.

Parameters:
Name Type Description
stx CIQ.ChartEngine

The chart object

parameters object

The configuration parameters

Properties
Name Type Description
panelName string

The name of the panel

band string

The name of the quote field to use as the series line

threshold number

The price where the horizontal line hits yaxis/series to enclose the fill area. If not set will look to parameters.reverse to determine if threshold is the lowest or highest value of the plot.

reverse boolean

Valid only if parameters.threshold is not set. If this parameter is set to true, threshold will be highest value of plot. Otherwise, threshold will be lowest value of plot.

direction number

1 to fill from the threshold upwards or -1 to fill from the threshold downwards

edgeHighlight object

Set to either a color or a Styles object as returned from CIQ.ChartEngine#canvasStyle to draw the threshold line.

edgeParameters object

The parameters to draw the threshold line as required by CIQ.ChartEngine#plotLine

opacity number

The color opacity/transparency as a decimal number (1= full opacity / no transparency). Default is 0.3.

color string

The fill color

Since:
  • 4.1.2 Removed quotes argument; function always uses dataSegment.
Example
if(sd.outputs.Gain) CIQ.preparePeakValleyFill(stx,{panelName:sd.panel, band:"Result " + sd.name, threshold:sd.study.centerline, direction:1, color:sd.outputs.Gain});
if(sd.outputs.Loss) CIQ.preparePeakValleyFill(stx,{panelName:sd.panel, band:"Result " + sd.name, threshold:sd.study.centerline, direction:-1, color:sd.outputs.Loss});

qs( [query])

A parsed query string object Does not support using multi-value keys (i.e. "a=1&a=2")

Parameters:
Name Type Argument Description
query string <optional>

Query string. If not provided then the browser location's query string will be used

Returns:

An object containing the parsed values of the query string

Type
object

readablePeriodicity(stx)

Creates a string with a periodicity that is easy to read given a chart

Parameters:
Name Type Description
stx CIQ.ChartEngine

A chart object

Returns:

A periodicity value that can be displayed to an end user

Type
string

rect()

Draws a rectangle on the canvas see CIQ.roundRect

Since:
  • 3.0.0 - function signature changed: This function now takes a params object instead of 8 different parameters

removeResizeListener(element, callback)

Removes an attached a callback to listen for an element.

Parameters:
Name Type Description
element node
callback function

replaceFields(obj, mapping)

This method will iterate through the object and replace all of the fields using the mapping object. This would generally be used to compress an object for serialization. so that for instance "lineWidth" becomes "lw". This method is called recursively.

Parameters:
Name Type Description
obj object

Object to compress

mapping object

Object containing name value pairs. Each name will be replaced with its corresponding value in the object.

Returns:

The newly compressed object

Type
object

reverseObject(obj)

This method reverses the fields and values in an object

Parameters:
Name Type Description
obj object

Object to reverse

Returns:

The reversed object

Type
object
Example
reverseObject({ one: "a", two: "b" }) // returns { a: "one", b: "two" }

roundRect(params [, edge])

Draws a rounded rectangle on the canvas.

Parameters:
Name Type Argument Description
params object
Properties
Name Type Argument Description
ctx object

A valid HTML Canvas Context

x number

Left position of drawing on canvas

top number

Top position of drawing on canvas

width number

Width of rectangle

height number

Height of rectangle

radius number

Radius of rounding

fill boolean <optional>

Whether to fill the background

txt number <optional>

Text for the label

y number <optional>

Y position of drawing on canvas

margin object <optional>

Margin around the text

Properties
Name Type Argument Description
left object <optional>

Left margin of text

top object <optional>

Top margin of text

backgroundColor number <optional>

background color. This is the background color of the rectangle

color number <optional>

Text color

edge string <optional>

"flush","arrow"

Since:
  • 3.0.0 - function signature changed: This function now takes a params object and the drawing type instead of 8 different parameters. Also, this function will draw the label if `params.txt` is present, otherwise just the floating label outline will be drawn

roundRectArrow(ctx, x, y, width, height, radius [, fill] [, stroke])

Draws a rounded rectangle with an arrowhead on the screen.

Parameters:
Name Type Argument Description
ctx object

A valid HTML Canvas Context

x number

Left position of drawing on canvas

y number

Top position of drawing on canvas

width number

Width of rectangle

height number

Height of rectangle

radius number

Radius of rounding

fill boolean <optional>

Whether to fill the background

stroke boolean <optional>

Whether to fill the outline

Since:
  • 3.0.0 - function signature changed: This function now takes a params object instead of 8 different parameters

safeClickTouch(div, fc, params)

Use this instead of onclick or ontouch events. This function will automatically use the quickest available but also protect against being called twice. By default any previous safeClickTouch listeners will be cleared (to allow re-use of the element).

Parameters:
Name Type Description
div object

The DOM element to attach an event

fc function

The function to call when the object is pressed

params object

Parameters to drive behavior.

Properties
Name Type Argument Default Description
safety object <optional>

An optional object, generated from a CIQ.safeDrag association to prevent the click from being triggered when a drag operation is released

allowMultiple boolean <optional>
false

If set then multiple click events can be associated with the node

preventUnderlayClick boolean <optional>
true

By default prevents an underlaying element from being "clicked" on a touch device 400ms after the overlay was tapped. Set to false for input fields, or any div containing input fields (body)

absorbDownEvent boolean <optional>
true

Ensures that a mousedown, pointerdown, touchstart event doesn't get passed to the parent.

Since:
  • 11/01/2015 Removed timers in favor of a new algorithm. This algorithm allows only the first event to fire from a UI interaction to execute the fc function.

safeDrag(div [, fcDown] [, fcMove] [, fcUp])

Safe function to handle dragging of objects on the screen. This method is cross-device aware and can handle mouse or touch drags. This method does not actually move the objects but provides callbacks that explain when drag operations begin and cease, and what movements are made during the drag. Callbacks should be used to move the actual objects (if it is desired to move objects during a drag operation). For convenience, displacementX and displacementY are added to callback events to indicate the distance from the original starting point of the drag. A "safety" object is returned which can optionally be passed into CIQ.safeClickTouch to prevent errant click events from being triggered when a user lets go of a drag

Parameters:
Name Type Argument Description
div object

The draggable DOM element

fcDown function <optional>

Callback function when a drag operation begins. Receives an event object.

fcMove function <optional>

Callback function when a drag move occurs. Receives an event object.

fcUp function <optional>

Callback function when the drag operation ends. Receives an event object.

Returns:

Safety object which can be passed to CIQ.safeClickTouch

Type
object

safeMouseOut(node, fc)

Used in conjunction, safeMouseOut and safeMouseOver ensure just a single event when the mouse moves in or out of an element. This is important because simple mouseout events will fire when the mouse crosses boundaries within an element. Note that this function will do nothing on a touch device where mouseout is not a valid operation.

Parameters:
Name Type Description
node object

A valid DOM element

fc function

Function to call when the mouse has moved out


safeMouseOver(node, fc)

This method is guaranteed to only be called once when a user mouses over an object. @see CIQ#safeMouseOut

Parameters:
Name Type Description
node object

A valid DOM element

fc function

Function to call when mouse moves over the object


scrub(obj [, removeNulls])

Deletes (removes) nulls or undefined fields (names) from an object. This is useful when marshalling (saving) an object where you don't wish null or undefined values to show up in the marshalled object (such as when converting to JSON)

Parameters:
Name Type Argument Description
obj object

The object to scrub

removeNulls boolean <optional>

Whether or not to remove null values


semiRoundRect()

Draws a rectangle on the canvas with just the right side curved corners see CIQ.roundRect

Since:
  • 3.0.0 - function signature changed: This function now takes a params object instead of 8 different parameters

setCaretPosition(ctrl, pos)

Sets the position of the cursor within a textarea box. This is used for instance to position the cursor at the end of the text that is in a textarea.

Parameters:
Name Type Description
ctrl object

A valid textarea DOM element

pos number

The position in the text area to position


shallowClone(from)

Non recursive clone. This will only clone the top layer and is safe to use when objects contain DOM nodes.

Parameters:
Name Type Description
from object

Object to be cloned

Returns:

A shallow clone of the "from" object

Type
object

standardUTCDate(dt)

Converts a date into YYYY-MM-DDTHH:MM:SSZ format (UTC)

Parameters:
Name Type Description
dt date

A JavaScript Date object

Returns:

Date in YYYY-MM-DDTHH:MM:SSZ format

Type
string

stripPX(text)

Strips the letters "px" from a string. This is useful for converting styles into absolutes.

Parameters:
Name Type Description
text string

String value with "px"

Returns:

The numeric value

Type
number
Example
var leftPosition=CIQ.stripPX(node2.style.left)

strToDate(dt)

Converts a string form date into a JavaScript object. Only use if you know that the string will not include a time, otherwise use @see CIQ.strToDateTime

Parameters:
Name Type Description
dt string

Date in string format such as MM/DD/YY or YYYYMMDD or 2014-10-25T00:00:00+00:00 or 201506170635

Returns:

JavaScript date object -new Date()-

Type
Date

strToDateTime(dt)

Converts a string form date into a JavaScript Date object with time. Supports various standard date formats

Parameters:
Name Type Description
dt string

String form of a date (such as yyyymmddhhmm, yyyy-mm-dd hh:mm, etc)

Returns:

A JavaScript Date object

Type
date

swapClassName(node, newClassName, oldClassName)

Convenience method for swapping two class names within a node. Such as for changing state.

Parameters:
Name Type Description
node object

A valid DOM element

newClassName string

The class name to swap in

oldClassName string

The class name to swap out


tickedRect(ctx, x, y, width, height, radius [, fill] [, stroke])

Draws a ticked rectangle on the canvas. For use in the y-axis label.

Parameters:
Name Type Argument Description
ctx object

A valid HTML Canvas Context

x number

Left position of drawing on canvas

y number

Top position of drawing on canvas

width number

Width of rectangle

height number

Height of rectangle

radius number

Radius of rounding

fill boolean <optional>

Whether to fill the background

stroke boolean <optional>

Whether to fill the outline

Since:
  • 3.0.0 - function signature changed: This function now takes a params object instead of 8 different parameters

timeAsDisplay(dt [, stx] [, precision])

Displays a time in readable form. If Internationalization is in use then the time will be in 24 hour Intl numeric format

Parameters:
Name Type Argument Description
dt date

JavaScript Date object

stx object <optional>

Optional chart object if Internationalization is in use

precision number <optional>

Optional precision to use. If null then hh:mm. CIQ.SECOND then hh:mm:ss. If CIQ.MILLISECOND then hh:mm:ss.mmmmm

Returns:

Human friendly time, usually hh:mm

Type
string

TradingCentral(stx, token, partner)

Controller class to assist in the creation and processing of Trading Centralâ„¢ API requests.

Parameters:
Name Type Description
stx CIQ.ChartEngine

A chart instance to modify

token string

Trading Central API token

partner number

Trading Central API parnter number


translatableTextNode(stx, english [, language])

Creates a document node which facilitates translation to other languages, if stx.translationCallback callback function is set. If there is no translationCallback, a standard text node is returned.

Parameters:
Name Type Argument Description
stx CIQ.ChartEngine

The chart object

english string

The word to translate

language string <optional>

Optional language. Defaults to CIQ.I18N.language.

Returns:

A node in the following form if translationCallback exists: translation If it does not exist, a text node is returned.

Type
Node

unappendClassName(node, className)

Removes a class name from a node if it is set

Parameters:
Name Type Description
node object

A valid DOM element

className string

The class name to remove


uniqueID()

Returns a short, pseudo unique ID based on the current time. Radix 36 is used resulting in a compact string consisting only of letters and numerals. While not guaranteed to be unique, this function has a high probability of uniqueness when it is triggered by human activity even in a large user base.

Returns:

A unique string consisting of letters and numerals

Type
string

withinElement(node, x, y)

Returns true if a point, in absolute screen position, is within an element

Parameters:
Name Type Description
node object

A valid DOM element to check whether the point overlaps

x number

Absolute screen X position of point

y number

Absolute screen Y position of pointer

Returns:

True if the point lies inside of the DOM element

Type
boolean

xIntersection(vector, y)

Determines the X value at which point Y intersects a line (vector)

Parameters:
Name Type Description
vector object

Object of type {x0,x1,y0,y1}

y number

Y value

Returns:
  • X intersection point
Type
number

yIntersection(vector, x)

Determines the Y value at which point X intersects a line (vector)

Parameters:
Name Type Description
vector object

Object of type {x0,x1,y0,y1}

x number

X value

Returns:
  • Y intersection point
Type
number

yyyymmdd(dt)

Converts a JavaScript Date to yyyy-mm-dd format

Parameters:
Name Type Description
dt date

JavaScript Date object

Returns:

Date in yyyy-mm-dd format

Type
string

yyyymmddhhmm(dt)

Converts a date into yyyymmddhhmm format

Parameters:
Name Type Description
dt date

A JavaScript Date object

Returns:

Date in yyyymmddhhmm format

Type
string

yyyymmddhhmmssmmm(dt)

Converts a date into yyyymmddhhmmssmmm format

Parameters:
Name Type Description
dt date

A JavaScript Date object

Returns:

Date in yyyymmddhhmmssmmm format

Type
string