Google Column Chart and set column color - Javascript Google Chart

Javascript examples for Google Chart:Column Chart


Google Column Chart and set column color

Demo Code

ResultView the demo in separate window

      <script type="text/javascript" src=""></script> 
      <script type="text/javascript">
      google.charts.load('visualization', '1.1', {packages: ['corechart']});
      function drawChart() {//from   ww  w .ja v a  2 s.  co m
        var data = google.visualization.arrayToDataTable([
          ['Class', 'Total',{role: 'style'}],
          ['A', 10,'color: #b0120a'],
          ['B', 30,'color: #004411'],
          ['C', 20,'color: #ffab91'],
          ['D', 30,'color: #004411']
        var options = {
          isStacked: false,
          title: 'Class wise total students',
        var chart = new google.visualization.ColumnChart(document.getElementById('columnchart_material'));
        chart.draw(data, options);
      <div id="columnchart_material" style="width: 100%; height: 100%;"></div>  

Related Tutorials