This guide is designed to help you create a comprehensive stock symbol page using TradingView widgets. This page will provide up-to-date and accurate information about any stock you choose to display. The basic structure for this page will be built using simple HTML, while further functionality will be provided by integrating TradingViewโs variety of widgets.
For instance, if we want to display the details for the NVDA symbol
instead of AAPL, we simply need to update the value of "symbol" in the options.
/* ... the other options ...*/
"proName": "FOREXCOM:SPXUSD", /* โ changed from FOREXCOM:SPXUSD */
Symbol names are defined using the syntax {EXCHANGE}:{NAME}.
/* - While itโs possible to use a custom parameter (like symbol) and JavaScript
to set the symbol manually, the tvwidgetsymbol parameter is recommended for
single-symbol widgets as it works automatically. ๐
"showSymbolLogo": true, /* โ show/hide from true or false */
"isTransparent": true,
Set weather the chart should be transparent or have a default background
# isTransparent
"displayMode": "adaptive",
"colorTheme": "dark", /* โ add from dark or light */
For instance, if we want to display the details for the NVDA symbol
instead of AAPL, we simply need to update the value of "symbol" in the options.
/* ... the other options ...*/
"symbol": "NASDAQ:NVDA" /* โ changed from NASDAQ:AAPL */
Symbol names are defined using the syntax {EXCHANGE}:{NAME}.
/* - While itโs possible to use a custom parameter (like symbol) and JavaScript
to set the symbol manually, the tvwidgetsymbol parameter is recommended for
single-symbol widgets as it works automatically. ๐
"dateRanges": [
"1d|1",
"5d|5",
"1m|30",
"1D|1D",
"60m|1W",
"all|1M"
],
/* ... the other options ...*/
"symbol": "BINANCE:BNBUSDT|1M" /* โ changed from 1M */
"theme": "dark", /* โ add from dark or light */
"colorTheme": "dark",
/* ... add custom color ...*/
"backgroundColor": "rgb(23, 26, 31)", /* โ changed from rgb(23, 26, 31) */
"upColor": "", /* โ add color */
"downColor": "", /* โ add color */
"borderUpColor": "", /* โ add color */
"borderDownColor": "", /* โ add color */
"wickUpColor": "", /* โ add color */
"wickDownColor": "", /* โ add color */
Set weather the chart should be transparent or have a default background
# isTransparent
"style": "1", /* โ add style 1 to 9 */
/* ... Set the container height and width ...*/
"width": "100%",
"height": "565", /* โ changed from 565 */
/* - To fix this, set a height for the <div> container in the CSS file, for example
height: 565px;. The widget will be displayed correctly,
without appearing collapsed.
Warning: The majority of widgets require that either the height is defined within the widget options, or if โUse container sizeโ is selected that the container element should have a specific height defined by the CSS rule / style for that element.
Apex Charts
After loading all the files, you are ready to build your first chart. To create a chart with minimal configuration, write as follows
ApexCharts is a modern JavaScript library for creating interactive charts and visualizations with an easy-to-use API. For detailed instructions and additional options, please consult the Apex Charts Documentation.