您好,我使用 highcharts 动态样条线。
当用户改变浏览器尺寸时,它会自动改变宽度尺寸。
<div id="container" style="min-width: 400px; height: 400px; margin: 0 auto"></div>
但是我这里有一个问题。
当我在表格中使用这个 div 时,它不起作用。
<table width="100%">
<tr>
<td><div id="container" style="min-width: 400px; height: 400px; margin: 0 auto"></div></td>
</tr>
</table>
最佳答案
The chart prevents the container from shrinking. The pure CSS workaround is to set position:absolute and width: 100% on the container, then it won't affect the layout of the table cell
只需在您的 div 中更改此内容即可:
<div id="container" style="min-width: 400px; width:100%; height: 400px; margin: 0 auto; position: absolute;">
并将其添加到您的 td 中:
<td style="vertical-align: top;" >
这是 jsFiddle:http://jsfiddle.net/9WhbG/1/
您可以在此处查看更多信息:https://github.com/highslide-software/highcharts.com/issues/1157
关于javascript - highcharts 动态样条线与表中的流体尺寸问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16286465/