2016-09-18 78 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

使用自動調整,但嘗試把你的圖表中的容器定義的最大寬度和最大高度(或根據媒體查詢定義不同的寬/高)。

相關問題