2016-09-18 32 views
-1

我一直在努力,没有成功,使这个代码响应。该autozize不断使图表太平坦,如果我使用的高度和宽度它甫一一些屏幕作品。如何让这个Javascript代码响应任何屏幕?

有什么想法?

具有高度和宽度

<!-- 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 --> 

Thaks!

回答

0

使用自动调整,但尝试把你的图表中的容器定义的最大宽度和最大高度(或根据媒体查询定义不同的宽/高)。

相关问题