2
I created a screen with several graphics using google Charts, but I need to print/export to pdf, xls, printer, only from everything I searched on the net I haven’t found anything yet, does anyone know somehow how I could do it?
From the most basic example, can anyone give me a light?!
<html>
<head>
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript">
google.load("visualization", "1", {packages:["corechart"]});
google.setOnLoadCallback(drawChart);
function drawChart() {
var data = google.visualization.arrayToDataTable([
['Task', 'Hours per Day'],
['Work', 11],
['Eat', 2],
['Commute', 2],
['Watch TV', 2],
['Sleep', 7]
]);
var options = {
title: 'My Daily Activities'
};
var chart = new google.visualization.PieChart(document.getElementById('piechart'));
chart.draw(data, options);
}
</script>
</head>
<body>
<div id="piechart" style="width: 900px; height: 500px;"></div>
</body>
</html>
Do you want to print #piechart only? You’ve tried "@media" and window.print?
– Guilherme Nascimento
I need to print both the #piechart and other elements that have as titles and texts, but in this example that I passed would be only the graphics generated. And I haven’t tried using @media yet, do you have an example for the case? Valew
– Marcelo Diniz