我一直在努力,但没有成功,使这个代码响应。自动调整使图表太平,如果我使用高度和宽度,它只适用于某些屏幕。
有任何想法吗?
高度和宽度
<!-- TradingView Widget BEGIN -->
<script type="text/javascript"
src="https://d33t3vvu2t2yu5.cloudfront.net/tv.js"></script>
<script type="text/javascript">
new TradingView.widget({
"width": 800,
"height": 600,
"symbol": "INDEX:MERV",
"interval": "D",
"timezone": "Etc/UTC",
"theme": "White",
"style": "1",
"locale": "es",
"toolbar_bg": "#f1f3f6",
"enable_publishing": false,
"allow_symbol_change": true,
"hideideas": true,
"show_popup_button": true,
"popup_width": "1000",
"popup_height": "650"
});
</script>
<!-- TradingView Widget END -->
自动调整大小
<!-- TradingView Widget BEGIN -->
<script type="text/javascript"
src="https://d33t3vvu2t2yu5.cloudfront.net/tv.js"></script>
<script type="text/javascript">
new TradingView.widget({
"autosize": true,
"symbol": "INDEX:MERV",
"interval": "D",
"timezone": "Etc/UTC",
"theme": "White",
"style": "1",
"locale": "es",
"toolbar_bg": "#f1f3f6",
"enable_publishing": false,
"allow_symbol_change": true,
"hideideas": true,
"show_popup_button": true,
"popup_width": "1000",
"popup_height": "650"
});
</script>
<!-- TradingView Widget END -->
谢谢!!
使用自动调整大小但尝试将图表放在具有已定义的最大宽度和最大高度的容器中(或根据媒体查询定义不同的宽度/高度)。