Odd problem here. I am constructing a highchart and placing it within a bootstrap 3 carousel. When the window is in any size but 'maximized', the chart labels and data all fit the area correctly. However when maximizing the window, both axis labels and titles are moved out of the visible space. The odd thing is that this happens even if the difference in window size from non-maximized to maximized is a few pixels.
Does anyone know of a fullscreen setting for highcharts or something similar that could be causing this? My avid googling has come up with nothing.
The chart construction code is rather long, but I will copy what is necessary here. Also note, that the setSize() animations and functionality is all perfect when the window is not maximized.
// The relevant highcharts code
var chartOptions = {
chartType: 'column',
reportContainer: 'reportResultsContainer',
chartContainerName: 'reportChart',
title: 'Driver Tonnages (Total ' + totalTonsSum.formatMoney(2, false) + ')',
//floatingTitle: true,
//titleY: 20,
chartName: 'Drivers',
yaxisName: 'Tons',
//rotateDegrees: -90,
chartData: deliveryData,
xAxisTitlePadding: '0px',
};
// later on
$('#' + chartContainerName).highcharts({
chart: {
plotBackgroundColor: null,
plotBorderWidth: null,
plotShadow: false,
type: chartType,
//margin: [50.50,50,50]
},
title: titleObject,
subtitle: subtitleObject,
tooltip: {
headerFormat: headerFormatHtml,
pointFormat: pointFormatHtml
},
plotOptions: {
column: {
allowPointSelect: true,
cursor: cursor,
dataLabels: {
enabled: true,
y: rotateDegrees != 0 ? -20 : 0, // 15 pixels up from the top
rotation: rotateDegrees,
formatter: dataLabelformat,
},
}
},
xAxis: {
type: 'category',
title: {
text: xaxisName,
useHTML: true,
style: { paddingTop: xAxisTitlePadding }
},
labels: {
step: xAxisLabelStep,
},
},
yAxis: {
title: {
text: yaxisName,
},
},
legend: {
enabled: false
},
series: [{
name: xaxisName,
type: chartType,
colorByPoint: true,
data: chartData,
}, ]
});
// the set size function, called on window resize
$('.highchart').each(function() {
$(this).highcharts().setSize($('#carouselContent').width() - 35, $('#carouselContent').height() - 35, doAnimation=true)
});
Here are the images of the charts. The first is when the window is minimized 2px under the maximized resolution. The second is the chart when maximized. Notice that the chart size as a whole is the same. http://imgur.com/a/7b4g2