Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

webtrader-charts

Package Overview
Dependencies
Maintainers
2
Versions
56
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

webtrader-charts

webtrader charts

  • 0.0.6
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
10
increased by400%
Maintainers
2
Weekly downloads
 
Created
Source

webtrader-charts Build Status

A charting library extracted from Webtrader so that other projects can use it as nodejs package

How to use it

Use npm / yarn

npm install --save webtrader-charts
yarn add webtrader-charts

You need to provide these dependences jquery, moment and highstock#5.0.x.
Take a look at webpack.config.js -> externals.

Basic usage

 import wtcharts from 'webtrader-charts';

 // init must be called before anything else.
 wtcharts.init({
    appId: 11,
    lang: 'en',
    server: 'wss://ws.binaryws.com/websockets/v3'
 });
 
 const chart =  wtcharts.chartWindow.addNewChart($parent, {
    "instrumentCode": "RDBULL",
    "instrumentName": "Bull Market Index",
    "timePeriod": "1m",
    "type": "line",
    "delayAmount": 0,
    "indicators": [
       {
          "id": "cks",
          "name": "Chande Kroll Stop",
          "options": {
             "period": 10,
             "maxMinPeriod": 20,
             "multiplier": 3,
             "longStopStroke": "#00C176",
             "shortStopStroke": "#FF003C",
             "strokeWidth": 1,
             "dashStyle": "Solid"
          }
       }
    ],
    "overlays": [ ],
 });

 // Will be called every time user makes a change
 chart.events.anyChange = () => {
    console.warn(chart.data());
    // Pass chart.data() to addNewChart() to restore a chart.
 }; 

 chart.actions.reflow(); // Resizes the chart, call it when container is resized.
 chart.actions.refresh(); // Refreshes the entire chart.
 chart.actions.destroy(); // Destroys the chart.

Globals

Handle notification by providing your own wtcharts.globals.notification.

 import $ from 'jquery';
 import 'jquery-growl'; // notification library
 export const globals = {
    notification: {
       error: (msg) => $.growl.error({message: msg}),
       warning: (msg) => $.growl.warning({message: msg}),
       notice: (msg) => $.growl.notice({message: msg}),
    }
 };

Keywords

FAQs

Package last updated on 05 May 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc