Using a listener that will cause a recount for the chart, and media queries in the CSS table should be printed at the specified size when printing the website.
JS:
$(function () { Highcharts.setOptions({ // Apply to all charts chart: { events: { beforePrint: function () { this.oldhasUserSize = this.hasUserSize; this.resetParams = [this.chartWidth, this.chartHeight, false]; this.setSize(600, 400, false); }, afterPrint: function () { this.setSize.apply(this, this.resetParams); this.hasUserSize = this.oldhasUserSize; } } } }); $('#container').highcharts({ title: { text: 'Rescale to print' }, subtitle: { text: 'Click the context menu and choose "Print chart".<br>The chart size is set to 600x400 and restored after print.' }, xAxis: { categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] }, series: [{ data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4] }] }); var printUpdate = function () { $('#container').highcharts().reflow(); }; if (window.matchMedia) { var mediaQueryList = window.matchMedia('print'); mediaQueryList.addListener(function (mql) { printUpdate(); }); } });
CSS:
@page { size: A4; margin: 0; } @media print { html, body { padding:0px; margin:0px; width: 210mm; height: 297mm; } #container { float:left; padding: 0px; margin: 0px; width: 80%; } }
HTML:
<script src="http://code.highcharts.com/highcharts.js"></script> <script src="http://code.highcharts.com/modules/exporting.js"></script> <div id="container" style="height: 400px;"></div>
JSFiddle: http://jsfiddle.net/w4ro5xb7/13/
Full screen test for better effect: http://jsfiddle.net/w4ro5xb7/13/show/