score:0
i found a simple workaround for exporting charts (printing)
and
i didn't use any plugin just little plain old css and some javascript
which in my case is
i wanted to print the chart with some specific html content of the page
or in my case i wanted to remove header , footer and left menu
i dint wanted to show buttons or unecessary content
and just show the page content , description table and chart
so here is i how i achieved it.
> CSS :-
<style type="text/css">
@media print{
@page
{
size: auto; /* auto is the initial value */
margin: 0mm; /* this affects the margin in the printer settings */
}
body{ background-color:#FFFFFF; background-image:none; color:#000000 }
.navimainbg{ display:none;}
.printhide{ display:none;}
.usercontent-footer{ display:none;}
.linkBTN{ display:none;}
.userheader{ display:none;}
.user-profile-left{ display:none;}
#userbgcontent{ width:100%;}
}
</style>
We are focussing on the print css here which we implied when the page is printed
acess the divs or portions of the page which you dont want ot be printed via their class or id depending upon your usage
for example
i didnt wanted to display the button
.linkBTN{ display:none;}
which can be simply called via javascript.
Javascript :->
<script type="text/javascript">
function printpage()
{
window.print()
}
<script type="text/javascript">
we can invoke the print function to print the page minus elements we dont want to print with the page via click of a button by calling function in my case "printpage" as you can see this button will also not display while printing as printhide class display is set to none while priting
<input title="Print a Printer Friendly Page" class ="printhide" type="button" value="Print this page" onclick="printpage()">
isnt is it a simple way to print chart other than highcharts printing if you want to print more
only con is that sometime the image will slide down when you want to show it along with some conetent due to lack of size to render an image . it will shift to next page . other than its tested working .
score:4
You can try to print the page , or make a pdf using php file functions to get the desired html content .
or you can try the method told by baba to get the image :)
score:13
There are so many direct and indirect way to achieve this
Use HTML Canvas : http://html2canvas.hertzen.com/
Using
wkhtmltoimage
Example
exec('wkhtmltoimage --quality 50 http://www.bbc.com bbc.jpg');
Using
wkhtmltopdf
+ImageMagic
-- Convert the web page to
pdf
using wkhtmltopdf-- Convert
pdf
tojpg
using ImageMagic
Example
exec("convert a.pdf a.jpg");
- Use PHP imagegrabwindow and imagegrabscreen
Example
$browser = new COM("InternetExplorer.Application");
$handle = $browser->HWND;
$browser->Visible = true;
$browser->Navigate("http://localhost");
/* Still working? */
while ($browser->Busy) {
com_message_pump(4000);
}
$im = imagegrabwindow($handle, 0);
$browser->Quit();
header("Content-Type: image/png");
imagepng($im);
imagedestroy($im);
Advance Examples
-- Also See Get Website Screenshots Using PHP
For Possible Issues : Getting imagegrabscreen to work
- use Webshort and call it from php using
exec
if you have python installed
Example
exec("python webshot.py https://example.com/webshot/php example.png");
- Download and use Website Thumbnail Generator
Example
webthumb.php?url=http://www.google.com&x=150&y=150
- Use boxcutter
Example
exec('boxcutter -f image.png');
- Capture Screenshots in PHP with GrabzIt
Example
$grabzIt = new GrabzItClient("APPLICATION KEY", "APPLICATION SECRET");
$id = $grabzIt->TakePicture("http://www.google.com", "http://www.example.com/GrabzItHandler.php");
- using wimg.ca
Example with this current page
http://wimg.ca/https://stackoverflow.com/questions/10328457/how-to-export-the-whole-page-or-html-content-with-highcharts-not-just-the-chart/10330701#10330701
Example
timthumb.php?src=http://www.google.com/&webshot=1
I think have given more than enough example
Source: stackoverflow.com
Related Query
- How to export the whole page or html content with Highcharts not just the chart?
- How do I export the content of a page as either jpg or pdf with Highcharts and scrollable data?
- The RTL language (Arabic) is not working with HighCharts pie chart correctly, how can I fix this?
- Highcharts not displaying anything just blank html page
- Can I with highcharts column stacking on hover not highlighting the whole serie
- Highcharts - how to export chart with different scale in one click
- How can I make milestone lines with a GANTT chart using the highcharts library?
- How can I display crosshair labels on top of the chart with Highcharts
- HighCharts title styles i.e textDecoration property not applying when we export the chart using canvg
- How to cover the whole pie chart with selected portion
- How to make a HighCharts drilldown column/bar chart that does not hide the non-drilldown categories
- How can I get HighCharts column chart to scale the yAxis to not have so much whitespace?
- Highcharts Chart Bar - How can I display in the chart, only one column from my HTML table?
- Highcharts - how to export chart with a custom legend?
- Highcharts - How to get the particular chart id on click of custom label in export options
- Highcharts do not hold all the values of stacked columns chart with data time axes
- How to modify the code so that Highcharts graph does not cover fixed navigation bar at the top of the page?
- Is it possible to export HTML along with SVG markup to the Highcharts Export Server (http://export.highcharts.com/)
- Highcharts When printing the chart does not fit the page
- Highcharts, How to show datatable when export PDF and not show pdf when normal with Drilldown Chart
- highcharts download not working from html page with iframe in IE
- How to display the value instead of percentage in a pie chart using jquery Highcharts
- Highcharts - how to have a chart with dynamic height?
- How do I rotate my HighCharts bar chart so its vertical, not horizontal?
- JavaScript - Export Div with SVG chart + HTML as and Image
- How to save an image of the chart on the server with highcharts?
- How to export a Highchart chart to PDF thanks to a button outside the chart?
- Highcharts Error #16: charts not showing on the same page
- How do you increase the performance of highcharts chart creation and rendering
- How to show a column with the value Zero in Column chart in Highcharts?
More Query from same tag
- HighCharts Data and Legend Ordering
- Highchart Funnel Chart not showing
- Highlight Highcharts Organization Chart nodes
- Parsing CSV based on Popup Properties
- Highcharts navigator padding generating new tick
- highcharts: use JSON in drilldown
- Bars does not show up when loading JSON encoded data from PHP in Highcharts
- Highstock, border around yAxis or different background colors for each yAxis?
- Highcharts maxWidth or maxHeight of map
- Highcharts : hiding bottom-most x axis grid line
- Is HighCharts supported in IE9?
- try catch on static function asp.net
- How to show only integer values on yAxis of HighChart?
- Highchart event LOAD is not working
- JSON data not showing in highstock Candlestick chart using PHP & MYSQL
- HighCharts gantt treegrid collapse details
- Memory leak using Highcharts + AngularJS
- Issue on Fitting Highcharts.js in Bootstrap 3 Panels
- Highchart - spider web chart - chart appears and part of the chart disappears
- Highstock not displaying year on tooltip
- can we make nested donut charts in highcharts?
- How can I display crosshair labels on top of the chart with Highcharts
- What is the best strategy for testing D3/HighCharts/SVG?
- Highchart multiaxis timeliine chart without rangeselector
- Can't get csv from Highcharts
- color in legend with range highcharts
- how to use tickInterval or step in the highcharts?
- Stock chart timeline buttons and date field left align with chart
- Highcarts: Hide xAxis categorie when serie is not visible
- How to achieve the best possible performance with mutable data and real-time charts in React?