You need to sign in to do that
Don't have an account?
Radhika pawar 5
convert google chart to image in VF page
I have one Requirement to convert google chart(graph) to image.i m using in VF Page
<!--- Bar Char Code -->
<center>
<script type="text/javascript">
//google.setOnLoadCallback(drawChart);
var functionname ="reading_report";
functionname = functionname.replace(/[^A-Z0-9]+/ig, "_");
//functionname = functionname.replace(/./g, '_');
window[functionname] = function() {
// Create and populate the data table.
var data = google.visualization.arrayToDataTable([
['Metrics', 'Beginner', 'Letter', 'Word', 'Para', 'Story'],
<apex:repeat value="{!lstReport}" var="report">
["{!report[0]}", {!report[1]}, {!report[2]}, {!report[3]}, {!report[4]}, {!report[5]}],
</apex:repeat>
]);
// Create and draw the visualization.
new google.visualization.ColumnChart(document.getElementById("reading_report")).
draw(data,
{title:"Reading Baseline Trends - National",
width:600, height:400,isStacked:true,
hAxis: {title: ""},
vAxis: {minValue: 0},
vAxis: {maxValue: 100}}
);
}
</script>
<div id="reading_report" class="googlechart"></div> </center>
<!-- End of Bar Chart -->
<!--- Bar Char Code -->
<center>
<script type="text/javascript">
//google.setOnLoadCallback(drawChart);
var functionname ="reading_report";
functionname = functionname.replace(/[^A-Z0-9]+/ig, "_");
//functionname = functionname.replace(/./g, '_');
window[functionname] = function() {
// Create and populate the data table.
var data = google.visualization.arrayToDataTable([
['Metrics', 'Beginner', 'Letter', 'Word', 'Para', 'Story'],
<apex:repeat value="{!lstReport}" var="report">
["{!report[0]}", {!report[1]}, {!report[2]}, {!report[3]}, {!report[4]}, {!report[5]}],
</apex:repeat>
]);
// Create and draw the visualization.
new google.visualization.ColumnChart(document.getElementById("reading_report")).
draw(data,
{title:"Reading Baseline Trends - National",
width:600, height:400,isStacked:true,
hAxis: {title: ""},
vAxis: {minValue: 0},
vAxis: {maxValue: 100}}
);
}
</script>
<div id="reading_report" class="googlechart"></div> </center>
<!-- End of Bar Chart -->
Gaurav Nirwal