HighCharts全宽问题 [英] HighCharts full width issue
本文介绍了HighCharts全宽问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我试图让我的渲染图填充父div的100%而没有成功。有没有什么办法可以消除左右两边的空隙?
var chart = new Highcharts.Chart({
图表:{
renderTo:'图表',
保证金:0,
宽度:300,
高度:200,
defaultSeriesType:'areaspline'
},
系列:[{
data:[33,4,15,6,7,8,73,2,33,4,25],
marker:{
enabled:false
}
}]
});
解决方案
如果删除选项宽度:300,高度:200
像这样:
var chart = new Highcharts.Chart({
图:{
renderTo:'图表',
保证金:0,
defaultSeriesType:'areaspline'
},
.. 。
它会自动填充容器。
Im trying to make my rendered chart fill 100% of the parent div with no success. Is there any way I can remove the gap on the left and right sides?
var chart = new Highcharts.Chart({
chart: {
renderTo: 'chart',
margin: 0,
width: 300,
height: 200,
defaultSeriesType: 'areaspline'
},
series: [{
data: [33,4,15,6,7,8, 73,2, 33,4,25],
marker: {
enabled: false
}
}]
});
解决方案
If you remove the options width: 300, height: 200
like this:
var chart = new Highcharts.Chart({
chart: {
renderTo: 'chart',
margin: 0,
defaultSeriesType: 'areaspline'
},
...
it will fill automatically the container.
这篇关于HighCharts全宽问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文