Open ghost opened 3 years ago
I have the same issue. I think it might have to do with the version of the Tradingview charting-library, but not 100% sure yet. If I find the answer, I will post it here. If you find the answer, please share it here.
Issue is in TradingView Chart charting_library.d.ts:
interface ChartingLibraryWidgetOption
remove container
but... the chart is still not displaying.. we're missing some key element here.
I will try with an older version of the Trading View charting_library, maybe that is the solution.
My delay is because the access to the Trading View charting_library is using my business partner github user and not mine, maybe you can try yourself?
Choose a charting_library version few months old to be sure.
To get an older version of any software in github click on "Comits" on the top right corner of the files list.
Let me try...
replaced with Release v18.044 (from c3634edc) …
No diff, for some reason there is no return for <div id={defaultProps.containerId} className="tradingview-chart" />;
charting_library
folder from https://github.com/tradingview/charting_library/ to /public
and to /src
folders.datafeeds
folder from https://github.com/tradingview/charting_library/ to /public
.But no chart is being returned…. What am i missing here ?
You need to add some code to pages/TradePage.tsx
Inside the "const RenderNormal" definition
Something like this:
const RenderNormal = ({ onChangeOrderRef, onPrice, onSize }) => { return ( <Row style={{minHeight: '900px', flexWrap: 'nowrap', }}>
<Col flex={'360px'} style={{ height: '100%' }}>
<Orderbook smallScreen={false} onPrice={onPrice} onSize={onSize} />
<TradesTable smallScreen={false} />
</Col>
<Col flex="auto" style={{ height: '100%', display: 'flex', flexDirection: 'column' }}>
<div style={{ height: '510px' }}><TVChartContainer /></div>
<UserInfoTable />
</Col>
<Col flex="400px" style={{ height: '100%', display: 'flex', flexDirection: 'column' }}>
<TradeForm setChangeOrderRef={onChangeOrderRef} />
<StandaloneBalancesDisplay />
</Col>
</Row>
); };
But depending on your design, the order of the windows and sizes can vary.
That is already inside that file:
const RenderNormal = ({ onChangeOrderRef, onPrice, onSize }) => {
return (
<Row
style={{
minHeight: '900px',
flexWrap: 'nowrap',
}}
>
<Col flex="auto" style={{ height: '100%', display: 'flex' }}>
<UserInfoTable />
</Col>
<Col flex={'360px'} style={{ height: '100%' }}>
<Orderbook smallScreen={false} onPrice={onPrice} onSize={onSize} />
<TradesTable smallScreen={false} />
</Col>
<Col
flex="400px"
style={{ height: '100%', display: 'flex', flexDirection: 'column' }}
>
<TradeForm setChangeOrderRef={onChangeOrderRef} />
<StandaloneBalancesDisplay />
</Col>
</Row>
);
};
But if you see, in the code that is already in the file, the TVChartContainer is missing.
But if you see, in the code that is already in the file, the TVChartContainer is missing.
? Can you explain this please.
you have to add it (Step 3 in README) import { TVChartContainer } from '../components/TradingView';
manually in TradePage.tsx
yes, you need to import TVChartContainer , as it is indicated in the instructions.
But then,
you also have to include that container somewhere in the rendering of the page.
In the code I sent to you it will show between the TradesTable and the TradeForm, on top of UserInfoTable
In that page you can change the arranging of the windows shown.
yeah thats why the compiler now returnss:
Compiled with warnings.
./src/pages/TradePage.tsx Line 28:10: 'TVChartContainer' is defined but never used @typescript-eslint/no-unused-vars
let me check you last comment and get back to you.
Aah that is a pretty important part i was missing... changed and now.
Compiled with warnings.
./src/components/TradingView/index.tsx Line 96:6: React Hook React.useEffect has missing dependencies: 'defaultProps.autosize', 'defaultProps.clientId', 'defaultProps.containerId', 'defaultProps.datafeedUrl', 'defaultProps.fullscreen', 'defaultProps.interval', 'defaultProps.libraryPath', 'defaultProps.studiesOverrides', and 'defaultProps.userId'. Either include them or remove the dependency array react-hooks/exhaustive-deps
and do you see the chart now?
Yes it is showing now ! Not the right dimensions or chart data but we're one step further ! i'll check if it works with the latests trading view chart aswell.
Great!
The dimensions are changed in the <div style={{ height: '510px' ... next to the
I have the same problem about the chart data and I was thinking it was the charting_library version.
If you find the solution, please share it?
sure! thnx pepeneif
it is a CORS issue..
Wow. Thanks for letting me know!!
I did what you wrote here and got this
Maybe you forgot step number 8 of the list given by wcrama ?
it means that you have to create a file called ".eslintignore", with "src/charting_library/charting_library.esm.js" as its content.
Like this?
yes
Wow. Thanks for letting me know!!
change -> export const BONFIDA_DATA_FEED inside bonfidaConnector This will make the chart work ! bonfida api does not work atm
Like this?
add these 2 lines src/charting_library/charting_library.esm.js src/components/TradingView/index.tsx
otherwise try older versions of tradingview from commits in github
Which version of the charting_library worked for you wcrama ?
Commits on May 26, 2021 Release v18.044 (from c3634edc) …
Great, thanks!
i also have added this line in charting_library.esm.js / eslint-disable no-unused-expressions /
I did as written here, but the graphs are not displayed. The terminal says the following: `Compiled with warnings.
./src/charting_library/charting_library.esm.js Line 102:70: Unexpected use of comma operator no-sequences Line 137:65: Unexpected use of comma operator no-sequences Line 204:59: Unexpected use of comma operator no-sequences Line 317:24: Unexpected use of comma operator no-sequences Line 321:63: Unexpected use of comma operator no-sequences Line 326:49: Unexpected use of comma operator no-sequences Line 375:72: Unexpected use of comma operator no-sequences Line 479:48: Unexpected use of comma operator no-sequences
./src/components/TradingView/index.tsx Line 96:6: React Hook React.useEffect has missing dependencies: 'defaultProps.autosize', 'defaultProps.clientId', 'defaultProps.containerId', 'defaultProps.datafeedUrl', 'defaultProps.fullscreen', 'defaultProps.interval', 'defaultProps.libraryPath', 'defaultProps.studiesOverrides', and 'defaultProps.userId'. Either include them or remove the dependency array react-hooks/exhaustive-deps`
Hurrah, the diagram is working, but there are two problems: 1) The selected trading pair is different from the pair in the chart. If you change the pair in DEX on the diagram does not change. 2) How to make diagrams in height more. The method above does not work.
Good work ! Would you like to share how you managed ?
I was able to setup new instance using most recent serum and TV library, just need to add the /* eslint-disable no-unused-expressions */
in front of ./src/charting_library/charting_library.esm.js.
can anyone send me the charting_library please or a link to find it? thanks
I was able to setup new instance using most recent serum and TV library, just need to add the
/* eslint-disable no-unused-expressions */
in front of ./src/charting_library/charting_library.esm.js.
Hi could you send me a copy of the charting library please??
Good work ! Would you like to share how you managed ?
can anyone send me the charting_library please or a link to find it? Been driving me mad last 2 weeks and cant find it nowhere thanks.. email cryptoc1980@gmail.com
Good work ! Would you like to share how you managed ?
can anyone send me the charting_library please or a link to find it? Been driving me mad last 2 weeks and cant find it nowhere thanks.. email cryptoc1980@gmail.com
Read the instructions, you need to request access from tradingview directly
Good work ! Would you like to share how you managed ?
scrams would care to share with us how you got amstadex working? We could compensate: Bunnynomics101@gmail.com
Good work ! Would you like to share how you managed ?
scrams would care to share with us how you got amstadex working? We could compensate: Bunnynomics101@gmail.com
You need help?
Not sure if anyone still need help but I'm happy to assist !
Did you ever get pass the "Error placing order Transaction failed: Instruction: InitializeAccount" when placing orders?
change -> export const BONFIDA_DATA_FEED inside bonfidaConnector
Hi Bro, change to what? The original version: export const BONFIDA_DATA_FEED = 'https://serum-api.bonfida.com/tv'; Thank you for your help!
Hi every one In my case solved by adding this comment to top ===/ eslint-disable / ==== of esm.js file in charting library and also changing the file construct by using baeutify contetnt extension in IDE.
Hi all,
After following the steps in readme and have been adding the folders charting_library datafeeds to /src and /public i receive errors on building. What did i do wrong here ?
Failed to compile.
/Applications/XAMPP/xamppfiles/htdocs/serum-dex-ui/src/components/TradingView/index.tsx TypeScript error in /Applications/XAMPP/xamppfiles/htdocs/serum-dex-ui/src/components/TradingView/index.tsx(52,11): Property 'container' is missing in type '{ symbol: string; datafeed: any; interval: Nominal<string, "ResolutionString">; container_id: string | undefined; library_path: string; locale: "en"; disabled_features: string[]; ... 7 more ...; theme: "Dark"; }' but required in type 'ChartingLibraryWidgetOptions'. TS2741