I got Blogger to work just fine. To do it, I started a new blog post, composed as HTML, and used the following:
<script type="text/javascript" src="https://www.google.com/jsapi"></script> <script type="text/javascript"> // Load the Visualization API and the piechart package. google.load('visualization', '1.0', {'packages':['corechart']}); // Set a callback to run when the Google Visualization API is loaded. google.setOnLoadCallback(drawChart); // Callback that creates and populates a data table, // instantiates the pie chart, passes in the data and // draws it. function drawChart() { // Create the data table. var data = new google.visualization.DataTable(); data.addColumn('string', 'Topping'); data.addColumn('number', 'Slices'); data.addRows([ ['Mushrooms', 3], ['Onions', 1], ['Olives', 1], ['Zucchini', 1], ['Pepperoni', 2] ]); // Set chart options var options = {'title':'How Much Pizza I Ate Last Night', 'width':400, 'height':300}; // Instantiate and draw our chart, passing in some options. var chart = new google.visualization.PieChart(document.getElementById('chart_div')); chart.draw(data, options); } </script> <div id="chart_div" style="width:400; height:300"></div> Start with this, and move on from there. On Sunday, June 9, 2013 1:08:25 PM UTC-4, Ashish wrote: > > I copied the following code to the editor [Options -> Compose Mode -> > Interpret Types HTML] but the chart is not showing on the blog post - > the HTML is hown literally. > > > <!-- > You are free to copy and use this sample in accordance with the terms > of the > Apache license (http://www.apache.org/licenses/LICENSE-2.0.html) > --> > > <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http:// > www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> > <html xmlns="http://www.w3.org/1999/xhtml"> > <head> > <meta http-equiv="content-type" content="text/html; charset=utf-8"/ > > > <title> > Google Visualization API Sample > </title> > <script type="text/javascript" src="http://www.google.com/jsapi"></ > script> > <script type="text/javascript"> > google.load('visualization', '1', {packages: ['corechart']}); > </script> > <script type="text/javascript"> > function drawVisualization() { > // Create and populate the data table. > var data = google.visualization.arrayToDataTable([ > ['SALARY RANGE', '% STUDENTS'], > ['[3-4)', 10.86], > ['[4-5)', 6.52], > ['[5-6)', 2.17], > ['[6-7)', 2.82], > ['[7-8)', 4.34], > ['[8-9)', 4.34], > ['[9-10)', 0], > ['[10-11)', 8.69], > ['[11-12)', 0], > ['[12-13)', 0], > ['[13-14)', 0], > ['[14-15)', 0], > ['[15-16)', 6.52], > ['[16-17)', 8.69] > ]); > > // Create and draw the visualization. > new > google.visualization.ColumnChart(document.getElementById('visualization')). > > draw(data, > {title:"Year 2013 Graduating Batch (BTech and MTech) > Campus Placement Salary Histogram", > width:1000, height:400, > hAxis: {title: "Salary in INR LPA"}} > ); > } > > > google.setOnLoadCallback(drawVisualization); > </script> > </head> > <body style="font-family: Arial;border: 0 none;"> > <div id="visualization" style="width: 600px; height: 400px;"></ > div> > </body> > </html> > -- You received this message because you are subscribed to the Google Groups "Google Visualization API" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/google-visualization-api?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
