tradingview / charting-library-examples

Examples of Charting Library integrations with other libraries, frameworks and data transports
MIT License
1.43k stars 768 forks source link

Next.js with TradingView #111

Closed PTBKoo closed 5 years ago

PTBKoo commented 5 years ago

Ive followed this example to try and integrate TV with Next.js https://github.com/tradingview/charting-library-examples/tree/master/react-javascript

First error I was getting was window was undefined so I added a check to import only when window was defined and was getting a new error: TypeError: Cannot set property 'TradingView' of undefined

Used this to help: https://github.com/zeit/next.js/wiki/FAQ

Link to main code: https://github.com/PTBKoo/nexttv/blob/master/pages/index.js

Steps to reproduce the behavior:

  1. Clone the repo @ https://github.com/PTBKoo/nexttv
  2. Add charting_library and datafeeds to static folder
  3. npm install
  4. npm run dev
  5. See error
Screen Shot 2019-06-18 at 4 48 32 PM
timocov commented 5 years ago

See #30

geun commented 5 years ago

@timocov I make PR for nextjs.

afsanefdaa commented 5 years ago

do you have an example to help me? I even can not get the library through this link https://github.com/tradingview/charting_library/ it is 404!

afsanefdaa commented 5 years ago

@timocov I make PR for nextjs.

I need help if you had the experience using trading view charts in nextjs. Could you please help me?

geun commented 5 years ago

@afsanefda you should authorize to access https://github.com/tradingview/charting_library

You can apply it https://www.tradingview.com/HTML5-stock-forex-bitcoin-charting-library/