tradingview / charting-library-examples

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

Change symbol programatically in react native (or react) #362

Open jalaliyev opened 8 months ago

jalaliyev commented 8 months ago

I am creating stock app with using React Native. I want to send some customization value to change chart. For instance, If user clicks Bitcoin or some other coin, I have to display appropriate coin info. Do we have acceptable coin list to validate? Another example should be, I want to display in 1 hour changes as default. If I select 1 week, I should be able to send this value to the TradingView widget.

Screenshot 2023-11-03 at 11 05 49

My real question is how can I send selected value from my source code to the lib?

Thanks!

romfrancois commented 8 months ago

I would suggest having a read at the documentation website to have a better understand on how the library and the datafeed work.

Do we have acceptable coin list to validate?

That's up to your datafeed. You cold have a function that would target a specific endpoint to return that list. But that's not something TradingView supports.

I want to display in 1 hour changes as default

If you want to set that resolution at the instantiation level that would be a Widget Constructor parameter to set. If that's at a later stage, you could use the setResolution API.