Hello! I have some column charts. 8 on one page. I am trying to get a trend line on these bar charts. (Note that the charts are all the same. It's just a bunch of dummy data). I added the code, but instead I got gridlines. Anyone have any idea why trend lines aren't appearing? I'm obviously very new at this. Thank you!
<html> <head> <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script> <script type="text/javascript"> google.charts.load('current', { 'packages': ['corechart', 'bar'] }); google.charts.setOnLoadCallback(drawChart); function drawChart() { var query1= new google.visualization.Query("https://docs.google.com/spreadsheets/d/12R_E7FU08AmNnoeeaZQVMQt9N1DSYmSmb0Q-xx9E7Kc/edit#gid=0?range=A1:B10"); query1.send(handleQueryResponse1); var query2 = new google.visualization.Query("https://docs.google.com/spreadsheets/d/12R_E7FU08AmNnoeeaZQVMQt9N1DSYmSmb0Q-xx9E7Kc/edit#gid=0?range=A1:B10"); query2.send(handleQueryResponse2); var query3 = new google.visualization.Query("https://docs.google.com/spreadsheets/d/12R_E7FU08AmNnoeeaZQVMQt9N1DSYmSmb0Q-xx9E7Kc/edit#gid=0?range=A1:B10"); query3.send(handleQueryResponse3); var query4 = new google.visualization.Query("https://docs.google.com/spreadsheets/d/12R_E7FU08AmNnoeeaZQVMQt9N1DSYmSmb0Q-xx9E7Kc/edit#gid=0?range=A1:B10"); query4.send(handleQueryResponse4); var query5 = new google.visualization.Query("https://docs.google.com/spreadsheets/d/12R_E7FU08AmNnoeeaZQVMQt9N1DSYmSmb0Q-xx9E7Kc/edit#gid=0?range=A1:B10"); query5.send(handleQueryResponse5); var query6 = new google.visualization.Query("https://docs.google.com/spreadsheets/d/12R_E7FU08AmNnoeeaZQVMQt9N1DSYmSmb0Q-xx9E7Kc/edit#gid=0?range=A1:B10"); query6.send(handleQueryResponse6); } function handleQueryResponse1(response) { var data = response.getDataTable(); var chart = new google.visualization.ColumnChart(document.getElementById('student_chart1')); var options = { isStacked: 'false', title: 'School Year 2016-17 Kindergarten: Before SBRI', curveType: 'function', legend: { position: 'bottom' }, colors: ['red', 'green'], pointSize: 20, series: { vAxis: { format: 'percent' }, hAxis: { minValue: '', maxValue: '', trendlines: { 0: { type: 'polynomial', color: 'black', degree: 1, visibleInLegend: true, } } } } }; chart.draw(data, options); } function handleQueryResponse2(response) { var data = response.getDataTable(); var chart = new google.visualization.ColumnChart(document.getElementById('student_chart2')); var options = { isStacked: 'false', title: 'School Year 2017-18 Kindergarten: Year one of SBRI', curveType: 'function', legend: { position: 'bottom' }, colors: ['red', 'green'], pointSize: 20, series: { vAxis: { format: 'percent' }, hAxis: { minValue: '', maxValue: '', trendlines: { 0: { type: 'polynomial', color: 'black', degree: 3, visibleInLegend: true, } } } } }; chart.draw(data, options); } function handleQueryResponse3(response) { var data = response.getDataTable(); var chart = new google.visualization.ColumnChart(document.getElementById('student_chart3')); var options = { isStacked: 'false', title: 'School Year 2016-17 First Grade: Before SBRI', curveType: 'function', legend: { position: 'bottom' }, colors: ['red', 'green'], pointSize: 20, series: { vAxis: { format: 'percent' }, hAxis: { minValue: '', maxValue: '', trendlines: { 0: { type: 'polynomial', color: 'black', degree: 3, visibleInLegend: true, } } } } }; chart.draw(data, options); } function handleQueryResponse4(response) { var data = response.getDataTable(); var chart = new google.visualization.ColumnChart(document.getElementById('student_chart4')); var options = { isStacked: 'false', title: 'School Year 2017-18 First Grade: Year one of SBRI', curveType: 'function', legend: { position: 'bottom' }, colors: ['red', 'green'], pointSize: 20, series: { vAxis: { format: 'percent' }, hAxis: { minValue: '', maxValue: '', trendlines: { 0: { type: 'polynomial', color: 'black', degree: 3, visibleInLegend: true, } } } } }; chart.draw(data, options); } function handleQueryResponse5(response) { var data = response.getDataTable(); var chart = new google.visualization.ColumnChart(document.getElementById('student_chart5')); var options = { isStacked: 'false', title: 'School Year 2016-17 Second Grade: Before SBRI', curveType: 'function', legend: { position: 'bottom' }, colors: ['red', 'green'], pointSize: 20, series: { vAxis: { format: 'percent' }, hAxis: { minValue: '', maxValue: '', trendlines: { 0: { type: 'polynomial', color: 'black', degree: 3, visibleInLegend: true, } } } } }; chart.draw(data, options); } function handleQueryResponse6(response) { var data = response.getDataTable(); var chart = new google.visualization.ColumnChart(document.getElementById('student_chart6')); var options = { isStacked: 'false', title: 'School Year 2017-18 Second Grade: Year one of SBRI', curveType: 'function', legend: { position: 'bottom' }, colors: ['red', 'green'], pointSize: 20, series: { vAxis: { format: 'percent' }, hAxis: { minValue: '', maxValue: '', trendlines: { 0: { type: 'polynomial', color: 'black', degree: 3, visibleInLegend: true, } } } } }; chart.draw(data, options); } </script> </head> <body> <table class="columns"> <tr><td><div id="student_chart1" style="width: 600px; height: 400px"></div></td> <td><div id="student_chart2" style="width: 600px; height: 400px"></div></td></tr> <tr><td><div id="student_chart3" style="width: 600px; height: 400px"></div></td> <td><div id="student_chart4" style="width: 600px; height: 400px"></div></td></tr> <tr><td><div id="student_chart5" style="width: 600px; height: 400px"></div></td> <td><div id="student_chart6" style="width: 600px; height: 400px"></div> </td> </tr> </table> </body> </html> -- You received this message because you are subscribed to the Google Groups "Google Chart API" group. To unsubscribe from this group and stop receiving emails from it, send an email to google-chart-api+unsubscr...@googlegroups.com. To post to this group, send email to google-chart-api@googlegroups.com. Visit this group at https://groups.google.com/group/google-chart-api. For more options, visit https://groups.google.com/d/optout.