Advanced Chart
The full VisualTrader chart, with toolbars, chart styles, indicators and drawing tools, ready to embed in any website.
Settings
Preview
Embed code
Copy this code and paste it into your site's HTML, where you want the widget to appear.
HTML
<!-- VisualTrader Widget BEGIN -->
<div class="visualtrader-widget-container" style="height:100%;width:100%">
<div class="visualtrader-widget-container__widget" style="height:100%;width:100%"></div>
<script type="text/javascript" src="https://widget.visualtrader.online/embed-widget-advanced-chart.js" async>
{
"symbol": "US.AAPL",
"interval": "D",
"range": "",
"style": "candle",
"theme": "dark",
"locale": "en",
"autosize": true,
"hide_top_toolbar": false,
"hide_side_toolbar": false,
"hide_bottom_toolbar": false,
"hide_volume": false,
"allow_symbol_change": false
}
</script>
</div>
<!-- VisualTrader Widget END -->Parameters
| Parameter | Default | Description |
|---|---|---|
| symbol | "US.AAPL" | Symbol — Traderlink code in MARKET.CODE format, e.g. MI.G, US.AAPL, LX.EURUSD. |
| interval | "D" | Interval — Candle timeframe. Ignored when a range is set."1" | "2" | "5" | "10" | "15" | "30" | "45" | "60" | "120" | "180" | "D" | "W" | "M" |
| range | "" | Range — Initial range shown; picks the interval automatically."" | "1D" | "5D" | "1M" | "3M" | "6M" | "YTD" | "1Y" | "5Y" | "All" |
| style | "candle" | Chart style — How prices are drawn."candle" | "bar" | "line" | "area" | "heikin-ashi" |
| theme | "dark" | Theme — Light or dark colors."light" | "dark" |
| locale | "it" | Language — Language of chart and toolbars."it" | "en" |
| autosize | true | Autosize — The widget fills the width and height of its container. |
| width | 980 | Width (px) — Used only without autosize. |
| height | 610 | Height (px) — Used only without autosize. |
| allow_symbol_change | false | Allow symbol change — Shows the symbol search in the toolbar. When off, clicking the symbol or typing in the chart emits the vt-widget:symbol-search event, so your page can open its own search. |
| hide_top_toolbar | false | Hide top toolbar — Hides intervals, style and indicators. |
| hide_side_toolbar | false | Hide drawing toolbar — Hides the side bar with drawing tools. |
| hide_bottom_toolbar | false | Hide range toolbar — Hides the bottom bar with ranges (1D, 5D, 1M, …, All). |
| hide_volume | false | Hide volume — Does not show the volume histogram. |
JavaScript events
The widget container emits DOM events you can listen to from your page:
HTML
<script>
document.querySelector(".visualtrader-widget-container")
.addEventListener("vt-widget:ready", (e) => console.log("ready", e.detail));
// anche: "vt-widget:symbol" (simbolo caricato), "vt-widget:symbol-change" (titolo cambiato dall'utente), "vt-widget:error"
// con allow_symbol_change: false il click sul simbolo, o iniziare a scrivere nel grafico,
// chiede alla tua pagina di aprire la ricerca titoli (e.detail.key = primo carattere digitato)
document.querySelector(".visualtrader-widget-container")
.addEventListener("vt-widget:symbol-search", (e) => console.log("ricerca titoli", e.detail.symbol, e.detail.key));
</script>FAQ
Is the widget free?
Yes, you can embed the widget on any website as long as you keep the attribution link to VisualTrader.
Can I add several widgets to the same page?
Yes, each snippet creates an independent widget. The browser downloads the script only once.
Which symbols can I use?
Traderlink codes in MARKET.CODE format, e.g. MI.G (Generali), US.AAPL (Apple), LX.EURUSD (Euro/Dollar).