This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Problem in generating bar graph from google chart from database extracted values?

My database table (test_12) is as follows: S.I A B C X Y
SBI234 2.280130800000 2.339592225000 2.237112614000 2.296371308000 2.295634019000
SBI316 1.832411563000 1.825578753000 1.830375097000 1.826226610000 1.831125007000
SBI425 1.922666139000 1.937724567000 1.913369116000 1.941975395000 1.937476796000
SBI567 1.926532891000 1.956353519000 1.978980200000 1.982052669000 2.001432287000

My Code used to draw bar graph (Google chart) is as follows:

    <html>   <head>
    <script type="text/javascript" src="&lt;a href=" https:="" www.gstatic.com="" charts="" loader.js"="" rel="nofollow">https://www.gstatic.com/charts/loader.js"></script>
    <script type="text/javascript">
      google.charts.load('current', {'packages':['bar']});
      google.charts.setOnLoadCallback(drawChart);

      function drawChart() {
        var data = google.visualization.arrayToDataTable([
          ['S.I','A','B','C','X','Y']
         
         ]);

     var options = {
          chart: {
            title: 'Google_Chart_Test',
            subtitle: 'Bar graph test',
          }
        };
           var chart = new google.charts.Bar(document.getElementById('columnchart_material'));

        chart.draw(data, google.charts.Bar.convertOptions(options));
      }
    </script>   </head>   <body>
    
</body> </html>

The Result i am getting is attached kindly help me to solve the problem. Database connection is showing, graph shows null values on all axis.enter image description here

php google chart mysql database

0 answers

No answers yet.

Log in to answer this question.