Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

google charts – Bar color

How can i change color of bar "BLACK"? Now its green


      function drawChart() {
        var data = google.visualization.arrayToDataTable([
          ['MODEL', 'CYAN', 'MAGENTA', 'YELLOW', 'BLACK'],
          <?php
          while($row = mysqli_fetch_array($exec))
          { 
            echo"['$row[1] - $row[0]', $row[5], $row[4], $row[3], $row[2]],"; 
          } 
          ?>
        
        ]);
        var options = { 
          chart: {
            title: "Stan tonerów z <?php echo $date ?>",
            titleTextStyle:{fontSize:76,},
            subtitle: ''
          },
          bars: 'horizontal' // Required for Material Bar Charts.
       };

i tried {role: ‘style’} but it dosent work

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

try the config option for: colors

    var options = { 
      chart: {
        title: "Stan tonerów z <?php echo $date ?>",
        titleTextStyle:{fontSize:76,},
        subtitle: ''
      },
      colors: ['CYAN', 'MAGENTA', 'YELLOW', 'BLACK'],
      bars: 'horizontal' // Required for Material Bar Charts.
   };
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading