react-tradingview-widget icon indicating copy to clipboard operation
react-tradingview-widget copied to clipboard

Tradingview Another Widget

Open emin-karadag opened this issue 5 years ago • 19 comments

Hello, Is there only one widget in this library? For example how do I add a TradingView Mini Chart Widget? Thank you...

emin-karadag avatar Jul 27 '19 17:07 emin-karadag

Hi! Thanks for the issue.

Yes, this component only wraps the advanced real-time chart widget. (And does so in a very simplistic way.)

The mini chart widget seems more difficult to use with React, but if you could point me at a React version of it, I could consider building a more complete library that includes all TradingView widgets.

Let me know! Thanks.

rafaelklaessen avatar Jul 28 '19 12:07 rafaelklaessen

Thank you for your reply. I would appreciate if you could build a library for the React version. :) Please includes all TradingView widgets :)))

emin-karadag avatar Aug 07 '19 08:08 emin-karadag

Thank you too

zeybar avatar Aug 09 '19 03:08 zeybar

Hi, I understand only the advanced real-time chart widget is usable. I was hoping to use this package for the TradingView Symbol Overview Widget. https://www.tradingview.com/widget/symbol-overview/ Any chance you know how to implement it in react? Thank you.

darrengoh97 avatar Nov 14 '19 23:11 darrengoh97

I know that @webmastersam has forked this repo here and has added some additional widgets... Perhaps you could look at that fork?

Would also be happy to merge said fork into this package.

rafaelklaessen avatar Nov 16 '19 13:11 rafaelklaessen

@rafaelklaessen I checked the repo. It doesn't include the widget I needed.

darrengoh97 avatar Nov 19 '19 01:11 darrengoh97

@darrengogh97, @emin-karadag If you need to create the missing widget it would be very easy. Just copy paste one of those. Check before copying the widget because they don't always work the same way. I think there's 2-3 different ways to instanciate the widge. Depending on the one you want, start from a widget that works the same way and you will be up and running in a matter of minutes.

WebMasterSam avatar Nov 19 '19 16:11 WebMasterSam

@WebMasterSam Hey can you please show me an example of how I could create a different widget?

IbrahimSam96 avatar Oct 24 '20 22:10 IbrahimSam96

@IbrahimSam96 can you send me the link of the plugin ? I will try to create the version in my branch for you.

WebMasterSam avatar Oct 26 '20 20:10 WebMasterSam

Fundamentals https://www.tradingview.com/widget/fundamental-data/

Market Overview https://www.tradingview.com/widget/market-overview/

Market Quotes https://www.tradingview.com/widget/market-quotes/

Thanks for offering your help!

IbrahimSam96 avatar Oct 26 '20 21:10 IbrahimSam96

I added the "Fundamentals" widget.

For the 2 others, please refer to this widget : "stock-list-widget". You have array parameters that requires a propType that is not listed in the Fundamentals widget.

WebMasterSam avatar Oct 27 '20 18:10 WebMasterSam

I'm sorry how can I access the Fundamentals widget ?

IbrahimSam96 avatar Oct 27 '20 18:10 IbrahimSam96

I just pushed it to my branch : https://github.com/WebMasterSam/react-tradingview-widget/blob/master/src/stock-fundamentals-widget.js

You can also find all of my plugins here https://github.com/WebMasterSam/react-tradingview-widget/blob/master/src/

WebMasterSam avatar Oct 27 '20 18:10 WebMasterSam

Hey, sorry I'm fairly new to the development space. Should I use it the same way I use the TradingViewWidget ? I tried copying the code and pasting but i get an error on onload. Thanks for your help and patience

IbrahimSam96 avatar Oct 27 '20 22:10 IbrahimSam96

You can fork my project and add the remaining components in it. If you want to use the project, you can reference it in your packages.json file, using that way : https://medium.com/@jonchurch/use-github-branch-as-dependency-in-package-json-5eb609c81f1a

Then you will be able to reference the components in your main project.

WebMasterSam avatar Oct 28 '20 15:10 WebMasterSam

By doing "npm install --save react-tradingview-widget", you installed the one in the NPM registry, which is not my/your version, but the original version (Rafael Klaessen's version).

It should be referenced that way (in your package.json file) : "react-tradingview-widget": "git://github.com/WebMasterSam/react-tradingview-widget.git"

Please add it manually. You can change the GIT path to anywhere you want in GIT (ex: to reference your fork).

WebMasterSam avatar Oct 29 '20 14:10 WebMasterSam

I adjusted the GIT address to your version in the package.json in the node modules. Should I normally just import TradingViewStockFundamentalsWidget from react-tradingview-widget

IbrahimSam96 avatar Oct 29 '20 15:10 IbrahimSam96

Example importing 3 components:

import { TradingViewStockInfoWidget, TradingViewStockProfileWidget, TradingViewStockFundamentalsWidget } from 'react-tradingview-widget'

Syntax is important. If you're not familiar with React, please follow some tutorials to help you with those basic principles. Importing can be done with different syntaxes, depending on how the components have been exported. It differs from package to package (depending on the dev's exporting preferences / architecture).

WebMasterSam avatar Oct 29 '20 15:10 WebMasterSam

I tried doing that but I'm still getting the TradingViewWidget instead of TradingViewStockFundamentalsWidget :(

IbrahimSam96 avatar Oct 29 '20 15:10 IbrahimSam96