I can't get my chart to show the bars in different colors based on the value. Here is the code:
<head> <!--Load the AJAX API--> <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(drawChartA); // Callback that creates and populates a data table, // instantiates the pie chart, passes in the data and // draws it. function drawChartA() { // Create the data table. var dataA = new google.visualization.DataTable(); dataA.addColumn('string', 'Year'); dataA.addColumn('number', 'Assets'); dataA.addRows([['2011', 410000 ],['2012', 413413 ],['2013', 415151 ],['2014', 417140 ],['2015', 419417 ],['2016', 422012 ],['2017', 424973 ],['2018', 424102 ],['2019', 423449 ],['2020', 423066 ],['2021', 422988 ],['2022', 423261 ],['2023', 423941 ],['2024', 425087 ],['2025', 426755 ],['2026', 429016 ],['2027', 431937 ],['2028', 435604 ],['2029', 440102 ],['2030', 445526 ],['2031', 451956 ],['2032', 459522 ],['2033', 468340 ],['2034', 478527 ],['2035', 490219 ],['2036', 369899 ] ]);var formatterA = new google.visualization.ColorFormat();formatterA.addRange(410000, 490219, 'green', 'grey')formatterA.addRange(369899, 409999, 'red', 'yellow')formatterA.format(dataA,1); // Set chart options var optionsA = {'title':'Assets', 'width':400, 'height':300, 'allowHTML':true}; // Instantiate and draw our chart, passing in some options. var chartA = new google.visualization.ColumnChart(document.getElementById('chart_div_assets')); chartA.draw(dataA, optionsA); } // Set a callback to run when the Google Visualization API is loaded. google.setOnLoadCallback(drawChartA); I m sure it is something simple that I am missing but for the life of me I can't figure it out. Your help as always is most appreciated.' Thx./Hal -- 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. For more options, visit https://groups.google.com/groups/opt_out.
