Coder Social home page Coder Social logo

rafaelklaessen / react-tradingview-widget Goto Github PK

View Code? Open in Web Editor NEW
263.0 13.0 96.0 307 KB

React component for rendering the TradingView Advanced Real-Time Chart Widget.

License: MIT License

JavaScript 100.00%
tradingview tradingview-widget tradingview-widget-react react reactjs webpack babel react-component

react-tradingview-widget's Introduction

react-tradingview-widget

React component for rendering the TradingView Advanced Real-Time Chart Widget.

Install

yarn add react-tradingview-widget or npm install --save react-tradingview-widget

Usage

Basic example

import TradingViewWidget from 'react-tradingview-widget';

const App = () => (
  <TradingViewWidget symbol="NASDAQ:AAPL" />
);

All given props are passed on to the widget config. See this page for the TradingView Advanced Real-Time Chart API.

Advanced example

import TradingViewWidget, { Themes } from 'react-tradingview-widget';

const App = () => (
  <TradingViewWidget
    symbol="NASDAQ:AAPL"
    theme={Themes.DARK}
    locale="fr"
    autosize
  />
);

Constants and API differences

react-tradingview-widget exports constants for the following things:

  • Interval types: IntervalTypes.D and IntervalTypes.W
  • Range types (for the range prop): RangeTypes.YTD and RangeTypes.ALL
  • Themes: Themes.LIGHT and Themes.DARK
  • BarStyles:
    • BarStyles.BARS
    • BarStyles.CANDLES
    • BarStyles.HOLLOW_CANDLES
    • BarStyles.HEIKIN_ASHI
    • BarStyles.LINE
    • BarStyles.AREA
    • BarStyles.RENKO
    • BarStyles.LINE_BREAK
    • BarStyles.KAGI
    • BarStyles.POINT_AND_FIGURE

You don't have to use these constants.

react-tradingview-widget also makes it possible to use numbers for interval, popup_width and popup_height instead of strings, but this is not required.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.