javascript - HighCharts + reveal.js 图表大小

标签 javascript jquery html highcharts reveal.js

我在 reveal.js 演示文稿中展示了很多图表,但我遇到了一个问题,我的一些图表随机调整了它们的大小,我需要刷新页面以使其再次恢复正常大小。这是代码

<section>
    <center>
        <div id="chart1" style="min-width: 465px; height: 600px; max-width: 900px;"></div>
    </center>
    </section>
<section>
<center>
        <div id="chart2" style="min-width: 465px; height: 600px; max-width: 900px;"></div>
</center>

我必须添加 <center></center>其他方式有时图表不会显示在幻灯片的中心,如果我也刷新页面,图表会居中。我加入了一些截图。 中心的问题:

Chart not at the center After Refresh 但是如果我输入 <center></center> 就没有问题了

尺寸问题: chart with a weird size chart after refresh

如果你们能帮我找到解决办法,或者如果你们知道发生了什么。

最佳答案

<section>
    <center>
       <div id="chart1" style="height: 600px; width: 900px;"></div>
    </center>
</section>

这解决了问题。

关于javascript - HighCharts + reveal.js 图表大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31257342/

相关文章:

javascript - meteor +铁路由器: Load FlowPlayer once template has finished

javascript - 最大高度的奇怪 Accordion 行为

javascript - 如何在等待响应时在网站中呈现加载页面

JavaScript:获取第一个月前 6 个月日期的最简单方法?

javascript - 如何在嵌套的html文件中执行脚本代码?

javascript - 前一个完成时的多个 ajax 调用

javascript - 在jquery中的ul中放置一个事件点击特定项目

jquery - 在一组中只选择一个复选框

javascript - 如何控制 Bootstrap Accordion 表单的可见性

html - 在纯 css 图片上向下滑动