From 7442669214545e3c3afb6ab35fe9b27e3c65dcf9 Mon Sep 17 00:00:00 2001 From: DR497 <47689875+dr497@users.noreply.github.com> Date: Wed, 7 Jul 2021 01:33:36 +0800 Subject: [PATCH] Add charts (#98) --- .gitignore | 6 + README.md | 19 --- public/index.html | 6 +- src/components/TradingView/index.tsx | 114 +++++++++++++----- .../TradingView/saveLoadAdapter.tsx | 92 ++++++++++++++ src/pages/TradePage.tsx | 16 ++- src/utils/tradingview.tsx | 10 -- src/utils/utils.tsx | 21 ++++ 8 files changed, 218 insertions(+), 66 deletions(-) mode change 100755 => 100644 src/components/TradingView/index.tsx create mode 100644 src/components/TradingView/saveLoadAdapter.tsx delete mode 100644 src/utils/tradingview.tsx diff --git a/.gitignore b/.gitignore index 753a576..eb3c059 100644 --- a/.gitignore +++ b/.gitignore @@ -25,3 +25,9 @@ yarn-error.log* .idea .env + + +# TV +public/charting_library +src/charting_library +public/datafeeds \ No newline at end of file diff --git a/README.md b/README.md index d0804e2..99cdff3 100644 --- a/README.md +++ b/README.md @@ -27,25 +27,6 @@ It is possible to add OHLCV candles built from on chain data using [Bonfida's AP - Copy `charting_library` folder from https://github.com/tradingview/charting_library/ to `/public` and to `/src` folders. - Copy `datafeeds` folder from https://github.com/tradingview/charting_library/ to `/public`. -3. Import `TVChartContainer` from `/src/components/TradingView` and add it to your `TradePage.tsx`. The TradingView widget will work out of the box using [Bonfida's](https://bonfida.com) datafeed. - -4. Remove the following from the `tsconfig.json` - -```json -"./src/components/TradingView/index.tsx" -``` - -5. Uncomment the following in `public/index.html` - -``` - -