Hi, I tried to populate the Google visualization api in a jinja template. I took the parameters of the sample and passed it to the API but it converts single and double quotes to 'and & Here is the script:
<script type="text/javascript"> //load the Google Visualization API and the chart google.load('visualization', '1', {'packages': ['columnchart']}); //set callback google.setOnLoadCallback (createChart); //callback function function createChart() { //create data table object var dataTable = new google.visualization.DataTable(); //define columns dataTable.addColumn('string','Quarters 2009'); dataTable.addColumn('string', 'Earnings'); //define rows of data // answerjson=answerjson.replace("'",'"'); {% set answerjson1='[["1": "Saturday"], ["6": "Sunday"], ["1": "Wednesday"], ["1": "Monday"], ["1": "Monday"], ["1": "Tuesday"], ["1": "Sunday"]' %} dataTable.addRows( {{answerjson1}} ); //instantiate our chart object var chart = new google.visualization.ColumnChart (document.getElementById('chart')); //define options for visualization var options = {width: 400, height: 240, is3D: true, title: 'Company Earnings'}; //draw our chart chart.draw(dataTable, options); } </script>
Here is the input passed to the API 
Please help me what I need to do.
python jinja2
shobhit
source share