plotlyjs-finance
A plotly.js finance chart wrapper
Available chart types
- Open-high-low-close (OHLC) charts
- Candlestick charts
Installation
npm install plotlyjs-finance
Examples
HTML page (more info on the plotlyjs homepage):
<!-- D3.js --> <!-- jQuery --> <!-- Plotly.js --> <!-- PlotlyFinance -->
Node.js script (more info on plotly-nodejs api homepage):
var PlotlyFinance = ;var plotly = 'username' 'apikey'; var fig = PlotlyFinance; var graphOptions = filename: 'ohlc-first' fileopt: 'overwrite' layout: figlayout; plotly;
more in examples/
API
PlotlyFinance.createOHLC
and PlotlyFinance.createCandlestick
take the same
arguments: a data
object and an opts
object.
-
data
is an object with required keysopen
,high
,low
andclose
linked to numerical arrays. Optionallydates
can be linked to an array of dates -
opts
is an object of plotlyjs trace options and/or adirection
key set to'both'
(the default),'increasing'
or'decreasing'