I'm trying to include a TradingView widget in Shiny, but all I see in the dashboard is a small blank window (of the correct size for the widget) followed by a "EURUSD Rates by TradingView" message. However, when I click on the "Open in Browser" option in the dashboard, the correct information is displayed in the browser window that was blank in the Shiny dashboard. I'm not using at all the Viewer in the pane that also has the File/Plots/Packages/Help/Viewer tabs.
The same behavior happens with other widgets from TradingView and other sites: they don't show up in the dashboard except for the one-line message at the bottom of the widget.
How to make the code below work and display the widget in the Shiny dashboard? Also, how to make it display at a specific location on the screen (instead of the top left corner)?
Thanks
# From https://www.tradingview.com/widget/single-ticker/
library(shiny)
ui <- fluidPage(
tags$div(
HTML('
<div class="tradingview-widget-container">
<div class="tradingview-widget-container__widget"></div>
<div class="tradingview-widget-copyright"><a href="https://www.tradingview.com/symbols/EURUSD/?exchange=FX" rel="noopener" target="_blank"><span class="blue-text">EURUSD Rates</span></a> by TradingView</div>
<script type="text/javascript" src="https://s3.tradingview.com/external-embedding/embed-widget-single-quote.js" async>
{
"symbol": "FX:EURUSD",
"width": 350,
"colorTheme": "dark",
"isTransparent": false,
"locale": "en"
}
</script>
</div>')))
server <- function(input, output, session) {}
shinyApp(ui, server)