Attribution web component <cq-attribution>
.
This will put a node inside a panel to attribute the data. Both the main chart panel (for quotes) and a study panel can use an attribution.
- Since:
-
2016-07-16
Example
<cq-attribution>
<template>
<cq-attrib-container>
<cq-attrib-source></cq-attrib-source>
<cq-attrib-quote-type></cq-attrib-quote-type>
</cq-attrib-container>
</template>
</cq-attribution>
Members
-
messages :object
-
Contains the attribution messages.
Override or augment the following properties of the
messages
object:sources
— An object that contains properties whose values populate<cq-attrib-source>
.exchanges
— An object that contains properties whose values populate<cq-attrib-quote-type>
.
For quotes, the source should match the quote source. For studies, the source should match the study type. If there is no matching source property, the associated component has no text.
Type:
- object
Examples
{ sources: { simulator: "Simulated data.", demo: "Demo data.", xignite: '<a target="_blank" href="https://www.xignite.com">Market Data</a> by Xignite.', fis_mm: '<a target="_blank" href="https://www.fisglobal.com/">Market Data</a> by FIS MarketMap.', Twiggs: 'Twiggs MF Formula courtesy <a target="_blank" href="https://www.incrediblecharts.com/indicators/twiggs_money_flow.php">IncredibleCharts</a>.' }, exchanges: { RANDOM: "Data is randomized.", "REAL-TIME": "Data is real-time.", DELAYED: "Data delayed 15 min.", RATES: "Yield data latest from source, bid/ask simulated.", BATS: "BATS BZX real-time.", EOD: "End of day data." }
var messages = document.querySelector("cq-attribution").messages; messages.exchanges.CUSTOMEX = "Text for custom exchange"; messages.sources.CUSTOMSOURCE = "Text for custom source";
cb({ quotes:[--array of quote elements here--], attribution: { source: "CUSTOMSOURCE", exchange: "CUSTOMEX" } });
Methods
-
displayAttribution( [stx])
-
Displays an attribution on the chart. Attributions are messages about the chart data source.
Called automatically whenever the data set is modified, but may also be called on demand.
Parameters:
Name Type Argument Description stx
CIQ.ChartEngine <optional>
The chart engine for which the attribution is displayed. Defaults to the chart engine contained in the context.
- Since:
-
8.3.0