q4.peerAnalysis
The Peer Analysis widget is used to display the peer median and peer average for a company. Peer List is created in the CMS (Site > Peer List).- Script link
- q4.studioApi.4.0.0.min.js
- Source file
- q4.studioApi.js, line 3307
This widget extends the q4.studioApi widget. It has all the options and methods of the parent widget, in addition to those below. See the parent widget's documentation for details.
Child widgets have all the options and methods of this widget, but may add their own as well. See the child widget's documentation for additional options or methods. This widget has the following child widgets:
Examples
<script type="text/javascript">
$('.peer-analysis-widget').peerAnalysis({
stockApi: "",
ticker: [""]
});
</script>
Options
- templateId number
-
The data template used based on the industry.
- Banks And Thrifts = 4
- Insurance Underwriter = 5
- REIT = 6
- Default value
4
- defaultTemplate string
-
Default template for out of the box use
ThetableTpl
anddisclaimerTpl
will contain the following variable:{{asOfDate}}
- the dates which signify the period end date for the data{{company}}
{{peer}}
{{companies}}
- array containing the data for companies included in the analysis. The company data will include:{{exchange}}
{{name}}
{{peer}}
- boolean signifying if the company is a peer{{periodEndDate}}
{{symbol}}
{{ticker}}
{{companyName}}
{{name}}
{{endsWithS}}
- boolean signifying if the last letter in the name is "s"
{{tables}}
- an array of subtemplates which relates to the templateId being used{{title}}
{{magnitude}}
{{first}}
- boolean{{headers}}
{{ticker}}
{{median}}
{{avg}}
{{items}}
{{definition}}
{{name}}
{{values}}
- object where the fields would either be{{avg}}
,{{median}}
or{{ticker}}
. Each field will contain the following:{{value}}
{{label}}
'<div class="peer-analysis_tables"><div>' + '<div class="peer-analysis_disclaimer"><div>'
- tableTpl string
-
Template for table data
'{{#tables}}'+ '<div class="peer-analysis_table" data-title={{title}}>'+ '<table class="table table--responsive">'+ '<thead>'+ '<tr>'+ '<td data-heading="{{title}} {{#magnitude}}({{magnitude}}){{/magnitude}}">{{title}} {{#magnitude}}({{magnitude}}){{/magnitude}}<td>'+ '<td>{{headers.ticker}}<td>'+ '<td>{{headers.median}}<td>'+ '<td>{{headers.avg}}<td>'+ '</tr>'+ '</thead>'+ '<tbody>'+ '{{#items}}'+ '<tr>'+ '<td class="peer-analysis_data-name">{{name}}<td>'+ '<td data-heading={{headers.ticker}}>{{values.ticker.value}}<td>'+ '<td data-heading={{headers.median}}>{{values.median.value}}<td>'+ '<td data-heading={{headers.avg}}>{{values.avg.value}}<td>'+ '</tr>'+ '{{/items}}'+ '</tbody>'+ '</table>'+ '</div>'+ '{{/tables}}'
- tablesSelector string
-
A selector for the table where the table template will be rendered
- Default value
.peer-analysis_tables
- disclaimerTpl string
-
Template for disclaimer
'<div class="peer-analysis_disclaimer">'+ '<em>Data for trailing four quarters.<em>'+ '{{#companyName}}'+ '<p>{{name}}\'{{^endsWithS}}s{{/endsWithS}} peer group consists of the following: '+ '<span class="peer-analysis_peer-list">'+ '{{#companies}}' + '{{#peer}}'+ '{{name}} ({{symbol}}){{^last}}, {{/last}}'+ '{{/peer}}'+ '{{/companies}}'+ '</span>'+ '</p>'+ '<p>{{name}}\'{{^endsWithS}}s{{/endsWithS}} financial data is as of {{asOfDate.company}}.<p>'+ '<p>Peer financial data is as of {{asOfDate.peer}}.<p>'+ '{{/companyName}}'+ '</div>'
- disclaimerSelector string
-
A selector for the disclaimer container where the disclaimer template will be rendered
- Default value
.peer-analysis_disclaimer
- beforeRender function
-
A callback that fires before the full widget is rendered. It is generally used to restructure/manipulate data before being passed into the
template
option.- Parameters
- event Event
- The event object.
- data Object
- The data object.