score:6
Here is an alternative solution that does the printing directly. It's based on the chart.print() function, but it works on multiple charts.
See the demo here: http://jsfiddle.net/jim31415/q5Rzu/150/
//--------------------------------------------------------------------
$("#print").click(function () {
printCharts([chart1, chart2, chart3]);
});
//--------------------------------------------------------------------
function printCharts(charts) {
var origDisplay = [],
origParent = [],
body = document.body,
childNodes = body.childNodes;
// hide all body content
Highcharts.each(childNodes, function (node, i) {
if (node.nodeType === 1) {
origDisplay[i] = node.style.display;
node.style.display = "none";
}
});
// put the charts back in
$.each(charts, function (i, chart) {
origParent[i] = chart.container.parentNode;
body.appendChild(chart.container);
});
// print
window.print();
// allow the browser to prepare before reverting
setTimeout(function () {
// put the charts back in
$.each(charts, function (i, chart) {
origParent[i].appendChild(chart.container);
});
// restore all body content
Highcharts.each(childNodes, function (node, i) {
if (node.nodeType === 1) {
node.style.display = origDisplay[i];
}
});
}, 500);
}
});
score:8
The exportChart method accepts parameters so you can send it more than one chart. However, the print method does not accept any parameters. So, to print you have to specify each chart separately like chart1.print(); and chart2.print(); which prints them each separately.
There are two workarounds:
Printing the whole page without using Highcharts printing. Here is an example.
You could export both of the charts to a pdf file and then print form there. Here is an example on how to export multiple charts to one pdf.
Source: stackoverflow.com
Related Query
- Button to show all legend items in highcharts
- How to instruct highcharts scatter chart to print all dataLabels
- Why code of Horizonal line(y-axis) on a single in Highcharts get applied to all other charts integrated with Webdatarocks
- Printchart title in highcharts when clicking print button when chart title is null
- Highcharts add a button after all the legends
- How to remove button from Highcharts
- Proper way to remove all series data from a highcharts chart?
- Highcharts Series - want to show/hide all EXCEPT selected series (reversal of default logic)
- Highcharts jQuery rendering problem - all browsers
- Remove Export and print button plugin on highchart chart
- How can i hide all the Series in highcharts at a time
- print a value on highcharts bar graph?
- Disable Print Chart option only from HighCharts
- Tooltip on custom button in Highcharts
- Always showing tooltip on all columns in Highcharts
- Highcharts chart click event fired on click of the reset zoom button (bug?)
- Custom Highcharts Context Menu Button Appearing in Every Chart on Page
- Highcharts : Chart with drilldown how to obtain click event of drill up button
- highcharts how to catch and insert logic in click reset zoom button event
- Enable or disable data labels shown in pie charts in Highcharts on click of a button
- Hide all but selected data series, HighCharts
- How can I delete all of the points from a highcharts series
- How to Check and Uncheck all the Legend elements in HighCharts Linechart?
- How to enable or disable a Highcharts tooltip when a button is clicked?
- remove print button
- Cannot remove all "series" in highcharts
- Can we change highcharts legend to work as radio button instead of checkbox style?
- Highcharts applying custom style to context button using css class
- Using PhantomJS to create HighCharts grahps server side for use in PDF creation (PHP) - results in exit code 11 from PHPs exec();
- Highcharts - Global configuration with common code and unique data & Headings
More Query from same tag
- Highcharts select chart by button click and adjust width
- Highcharts yAxis text rotation issue in IE8
- React Highcharts change border color on selected column from local state
- Highcharts - tooltip time value does not match xAxis
- series declared dynamically Highcharts
- How to draw SVG shapes at a specific position (dependent on the xAxis)
- How to use HighChart in offline?
- how to auto create pdf using highchart graphs
- How to disable LegendClick event in HighCharts using the Objective-C wrapper?
- Highchart completely loaded after animation event
- Highstock chart - selecting '1 month' button in rangeSelector not changing button style as selected
- Conflict between Highcharts and JQuery 1.8.2
- How refresh title highchart
- How to make highcharts scrollable horizontally when having big range in x-axis
- highchart json data points
- Highstock: How to change flag fill colour on click
- Highcharts - drill down to multiple series in R
- How to customize tooltip styling in for Scatter plot in Highchart?
- Wants to change the marker color HighCharts
- high chart graph doesnt start from the correct month
- Ajax Calls in highchart.js
- Highcharts series doesnt show data and render the chart
- Add textbox to chart and draw strings
- Highcharts - how to get consistent mouseover and mouseout events for columns?
- Drilldown more than 1 subreport using Highcharts
- Uncaught Error: Highcharts error #17 while creating sunburst chart using react
- How to color series legend in highcharts when colorbypoint is set to true
- External legend in Highcharts
- Create chart in tooltip formatter
- Highcharts adjust first and last tick on x-axis to direct values