简体   繁体   English

谷歌图表的问题是bootstrap Modal

[英]Issue with google chart is bootstrap Modal

When i am trying to add a google chart in bootstrap modal , it is coming in a small size , I have added a resize function to redraw it when the screen size changes . 当我试图在bootstrap模式中添加一个谷歌图表 ,它是一个小尺寸 ,我已经添加了一个调整大小功能,以便在屏幕大小更改时重绘它。

Still the chart onLoad is small but when i resize the window, it occupies the full width. 仍然图表onLoad 很小但是当我调整窗口大小时,它占据了整个宽度。

The issue is not coming when i am adding google chart in normal html page . 当我在正常的html页面中添加谷歌图表时,问题不会出现

Normal HTML Page and Bootstrap Modal Page Normal HTML PageBootstrap Modal Page

Any type of help is appreciated :) 任何类型的帮助表示赞赏:)

Override bootstrap's modal-dialog width setting: 覆盖bootstrap的模态对话框宽度设置:

<div class="modal-dialog" style="width:100%">

... and call your resize function once the modal is open: ...并在模态打开后调用调整大小函数:

$('#myModal').on('shown.bs.modal', function () {
    resize();
});

Using Bootstrap's modal events 使用Bootstrap的模态事件

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM