Last active
August 11, 2016 05:06
-
-
Save uakhan/cd29f2567768c4b6dcc75aff834ada73 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* before iniliatinzg highcharts */ | |
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; | |
} | |
} | |
} | |
}); | |
/* after initilizing highcharts - (make sure all the instances are added) */ | |
var printUpdate = function () { | |
$('#chart_example').highcharts().reflow(); | |
$('#chart_example_2').highcharts().reflow(); | |
}; | |
if (window.matchMedia) { | |
var mediaQueryList = window.matchMedia('print'); | |
mediaQueryList.addListener(function (mql) { | |
printUpdate(); | |
}); | |
} | |
/* css, goes between @media print { } */ | |
.container.main_wrap { | |
padding: 0; | |
} | |
.col_content { | |
background: none; | |
padding: 0; | |
padding-top: 20px; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment