Hi,
I have developed a for open window and in windows i am display in
google chart. when i close this window, I am getting error. becuase
of my div and google chart are storing in the buffter.
when i use following javascript it is working but my original(backand screen changing,
after some type it getting original screen which i stored in (var originalContents)
so i want store my original screen after close window chart.. So give my advice
how to do avoid error..
I want work perfect. I press linkbutton to open window by javsscript(one time or more time)
it should not getting error.. Other wise give another solution but with practically code to
open window display google chart..
I think my problem in :
document.body.innerHTML = originalContents;
<script type="text/javascript">
function PrintDiv() {
var showActivityChart = document.getElementById('<%=dActivityChart.ClientID %>');
showActivityChart.style.display = "none";
var logo = document.getElementById('<%=dMainLogoPrint.ClientID %>');
logo.style.display = "block";
var hideActivityChart = document.getElementById('<%=dHideActivityChart.ClientID %>');
hideActivityChart.style.display = "block";
drawhideActivityChart();
var printContents = document.getElementById('<%=dChartContainer.ClientID %>').innerHTML;
var originalContents = document.body.innerHTML;
document.body.innerHTML = printContents;
window.print();
document.body.innerHTML = originalContents;
divHide();
}
</script>
<script type="text/javascript">
function divHide() {
var logo = document.getElementById('<%=dMainLogoPrint.ClientID %>');
logo.style.display = "none";
var hideActivityChart = document.getElementById('<%=dHideActivityChart.ClientID %>');
hideActivityChart.style.display = "none";
}
</script>
<script type="text/javascript">
google.load("visualization", "1", { packages: ["corechart"] });
//Do not call this method on pageload
//google.setOnLoadCallback(drawhideActivityChart);
function drawhideActivityChart() {
var data = new google.visualization.DataTable();
data.addColumn('string', 'Status');
data.addColumn('number', 'TotalStatus');
data.addRows(2);
<%= SetFarmerChart() %>
var activityChart = new google.visualization.PieChart(document.getElementById('activityChart'));
activityChart.draw(data, { title: 'Farmer Status Details', titleTextStyle: { color: 'Maroon', fontSize: '20', fontStyle: 'normal' }, is3D: 'true', tooltip: { text: 'value' }, pieSliceText: 'value', legend: 'right', width: 600, height: 320 });
}
</script>