1.1.0 • Published 3 years ago

aframe-stock-ticker v1.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

aframe-stock-ticker

Latest NPM release Minzipped size License

An aframe component for displaying live stock tickers. Also works with cryptocurrency and forex.

Example gif

Usage

crypto-chart

To create a crypto chart, add the crypto-chart component.

<a-entity crypto-chart="id: ethereum; days: 30; width: 5; height: 2.5;"></a-entity>

Uses the Coingecko API to gather data. This API doesn't require an API key, and works out of the box with the code above.

stock-chart

To create a stock chart, add the stock-chart component.

<a-entity stock-chart="symbol: AMC; interval: 30min; length: 100; width: 5; height: 2.5;"></a-entity>

Uses the Twelve Data API to gather data. This API works for any asset type - stocks, forex, and crypto - but it requires an API key. An API key can be acquired here for free, with a limit of 800 requests / day.

Once you have a Twelve API key, set window.TWELVE_API_KEY equal to it, as seen at the top of the example.

Properties

crypto-chart

Properties

PropertyDescriptionDefault
idid of the target token. Full list available as a JSON here"Ethereum"
dayshow many days back to display data from. Can only be: 1,7,14,30,90,180,365,max14
widthwidth of the chart4
heightheight of the chart2
refreshRatehow often to refresh the chart data, in seconds30
backgroundColorthe color of the chart background"#333"
enableBackgroundwhether to enable a background behind the candlestrue
enableTitlewhether to display the ticker name on the charttrue
enablePriceswhether to display the prices on the charttrue
coloredWickswhether to display wicks in the candlestrue

Members

MemberDescriptionPath
timeseriesthe current timeseries data.el.components"crypto-chart".timeseries

stock-chart

Properties

PropertyDescriptionDefault
symbolsymbol of the target asset."AMC"
intervalchart interval, how long each candle represents"15min"
lengthhow many candles to display100
widthwidth of the chart4
heightheight of the chart2
refreshRatehow often to refresh the chart data, in seconds30
backgroundColorthe color of the chart background"#333"
enableBackgroundwhether to enable a background behind the candlestrue
enableTitlewhether to display the ticker name on the charttrue
enablePriceswhether to display the prices on the charttrue
coloredWickswhether to display wicks in the candlestrue

Members

MemberDescriptionPath
timeseriesthe current timeseries data.el.components"stock-chart".timeseries

Events

EventDescriptionEvent.detail
price_increasefired on chart refresh, if the price has increased{name: asset name, price: current price, candle: latest candle}
price_decreasefired on chart refresh, if the price has decreased{name: asset name, price: current price, candle: latest candle}
1.1.0

3 years ago

1.0.0

3 years ago