जब मैं नीचे दाएं फ्रेम को प्रिंट कर रहा हूं तो टेक्स्ट some text
आंशिक रूप से हाइचार्ट्स द्वारा कवर किया गया है क्योंकि वे प्रिंटिंग से पहले आकार बदलते नहीं हैं। वेबसाइट के लिए @media print
के साथ प्रिंटिंग लेआउट को कॉन्फ़िगर करने का कोई समाधान है और जब वेबसाइट मुद्रित होती है तो कंटेनर आकार में पुनर्वितरण/आकार बदलने के लिए हाईचार्ट्स को बल दें?वेबसाइट प्रिंट करते समय हाईचार्ट का पुनर्विक्रय/आकार बदलें
एचटीएमएल
<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>
<div id="container" style="height: 400px"></div>
जावास्क्रिप्ट
$(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]
}]
});
});
में आपका स्वागत है ज्यादातर परीक्षण किया गया। मैंने JSFiddle इनलाइन से कोड शामिल करने के लिए अपनी पोस्ट संपादित की है। कोड इनलाइन को शामिल करने के लिए एसओ पर प्रश्नों के लिए यह अधिक उपयुक्त है क्योंकि लिंक कभी मरने पर सवाल बेकार हो जाएगा। – IKavanagh
आपको बहुत धन्यवाद – user3665396