npm install binary-charts --save
Or by including the file via CDN and a script tag:
<script src="https://npmcdn.com/binary-charts@3.16.0/lib/binary-charts.js"></script>
npm install
npm start
open localhost:9001
To build the project:
npm install
npm run compile
To run unit tests:
npm test
For live rebuild during development:
webpack --watch
open example/index.html
Install in your project:
npm i binary-charts --save
Render the component and pass ticks array to visualize:
<BinaryCharts ticks={ticks} />
Ticks array is in a format [{ epoch, quote }]. Like:
var ticks = [
{ epoch: 123, quote: 95.4 },
{ epoch: 124, quote: 95.3 },
{ epoch: 125, quote: 95.6 }
];
The component can optionally display the trade parameters or contract already bought.
<BinaryCharts ticks={ticks} trade={trade} />
or
<BinaryCharts ticks={ticks} contract={contract} />
Trade and contract properties have the exact format as accepted or returned by the API.
Dynamically loading more data when needed by the chart will be available soon.