q4.dividends
Add a dividends table to your websiteRecent Version Updates:
1.3.3 - Dividends chart fixed so that it no longer ignores data from beforeRender
- Script link
- q4.dividends.1.3.3.min.js
- Source file
- q4.dividends.js, line 2
- Requires
Options
- url
-
Domain name where api exists
- stock Array.<string>
-
The Stock Exchange the corresponding `symbol` belongs to, in the following format: 'Exchange:Symbol'.
If a custom name should be used visibly on the site, list this after the value. This will load the data using the first string,
but allow you to control the appearance of the exchange/symbol text that is rendered using the second string.
If no value is provided for this array, the widget will attempt to use an entry from the indices lookup list. More info under `lookupIndex` option.
- Example
stock: ['NYSE:GDDY']
- Example
stock: ['NYSE:GDDY', 'CoolExchangeName:CoolSymbolName']
- lookupIndex interger
-
If no symbol or exchange are provided in the `stock` option, the widget will fall back to using the indices lookup list.
The `lookupIndex` option will allow you to target which lookup entry you wish to use for this widget, based on it's index number.
The default value is 1, meaning it will load the first lookup entry (ie. the one at the top of the list).
- Default value
1
- pageSize interger
-
All items will be loaded, this options will only limit the rendered results
- dateFormat string
-
A date format string to use with jQuery UI's Datepicker.
- Default value
mm/dd/yy
- sortAscending boolean
-
Whether to sort items in ascending chronological order.
- Default value
false
- yearSelect string
-
A CSS selector for a year select element.
- Default value
null
- yearTemplate string
-
A Mustache.js template for a single year rendered within the yearSelect element.
- Default value
'<option value="{{year}}">{{year}}</option>'
- itemContainer string
-
A CSS selector for the items container.
- Default value
null
- itemTemplate string
-
If itemContainer is defined, the template used to render each dividend year.
The following template data is available:
{{year}} {{yearlyDividend}} {{Code}} {{Currency}} {{DeclaredDate}} {{DividendAmount}} {{ExDate}} {{PayDate}} {{PaymentFrequency}} {{RecordDate}} {{Type}}
- itemLoadingMessage string
-
A message or HTML string to display while first loading the dividend year items.
- Default value
'<p class="module_loader"><i class="q4-icon_spinner"></i><span class="sr-only">Loading items...</span></p>'
- itemNotFoundMessage string
-
A message or HTML string to display in the
itemContainer
if no items are found.- Default value
<p><i class="q4-icon_warning-line"></i> No dividends found.</p>
- startYear interger
-
If yearSelect is defined, determines which dividend year will be rendered first.
- Default value
new Date().getFullYear()
- fixedDecimalPoints interger
-
The amount of decimal points for the dividend amount
- Default value
2
- renderChart boolean
-
If set to true, a Highchart will be rendered to the id specified by the "chart" option's id property (default "chart").
- Default value
false
- chart object
-
Basic chart configuration options
- Default value
'{id: "chart", color: "66, 139, 202", title: "Common Equity Dividends", type: "column", xAxisText: "Payout Period/Date", yAxisText: "Actual Dividend Paid", seriesName: "Common Equity Dividend ($)",drillUpText: "◁" }'
- template
-
The "master" template to be appended onto the page.
If `groupByYears` is set to true, this template will render for each year.
The following data is available:
{{Code}} {{Currency}} {{DeclaredDate}} {{DividendAmount}} {{ExDate}} {{PayDate}} {{PaymentFrequency}} {{RecordDate}} {{Type}}
- loadingClass string
-
A CSS class to add to the widget while data is loading. This can be used to show and hide elements within the widget.
- loadingMessage string
-
A message or HTML string to display while first loading the widget.
- Default value
'<p class="module_loader"><i class="q4-icon_spinner"></i><span class="sr-only">Loading items...</span></p>'
- beforeRender function
-
A callback that fires before the full widget is rendered.
- Parameters
- event Event
- The event object.
- templateData Object
- The complete template data.
- itemsComplete function
-
A callback that fires after yearly items are rendered.
- Parameters
- event Event
- The event object.
- complete function
-
A callback that fires after the entire widget is rendered.
- Parameters
- event Event
- The event object.