[英]Resizing Highchart based on window size
嗨,我已经离开了导航菜单,右侧的内容是高级图。 以下是我的Highchart配置,
this.InputData = {
chart: { type: 'column' },
title : { text : 'Overview' },
xAxis: {
categories: this._weekValues
},
yAxis: {
allowDecimals: false,
title: { text: 'some title'},
min: 0,
max: 100,
labels: {
formatter:function() {
var pcnt = (this.value / 100) * 100;
return Highcharts.numberFormat(pcnt, 0) + '%';
}
}
}
}
我有一个功能,将在更改左侧菜单的大小时触发,
this.menuEvent.onChangeLeftMenu().subscribe(()=>{
Observable.timer().subscribe(()=>{
console.log('highchart redraw?');
});
});
如何在更改左侧菜单大小时redraw
或调整图表大小? 目前图表溢出我的div包装器。 先谢谢你们。
$('#add').click(function () {
chart.addAxis({ // Secondary yAxis
id: 'rainfall-axis',
title: {
text: 'Rainfall'
},
lineWidth: 2,
lineColor: '#08F',
opposite: true
});
chart.addSeries({
name: 'Rainfall',
type: 'column',
color: '#08F',
yAxis: 'rainfall-axis',
data: [49.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4]
$(this).attr('disabled', true);
$('#remove').attr('disabled', false);
});
$('#remove').click(function () {
chart.get('temperature-axis').remove();
$(this).attr('disabled', true);
$('#add').attr('disabled', false);
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.