我正在使用C3.js,当我有大量数据时,图表的显示效果不佳,这是因为其高度。 C3以某种方式将固定高度设置为仅显示底部标签。我尝试使用图例:{show: false}属性,但不能正确解决我的问题。

看起来是这样的:

我放置图表的代码:

<div id="chart_product" class="section-to-print"> </div>

和CSS:

.section-to-print, .section-to-print * {
   visibility: visible;
}

.section-to-print {
   position: absolute;
   left: 0;
   top: 0;
}

最后,当我检查DOM时,将div设置如下:

非常感谢您的帮助。谢谢!

最佳答案

<div style='width:1000px;height:300px;'>
    <div id="chart_product" class="section-to-print"> </div>
</div>

请用另一个div包围图表div,您可以动态更改宽度和高度。

07-24 09:47
查看更多