Add a RGBA color to google line chart - Javascript Google Chart

Javascript examples for Google Chart:Line Chart

Description

Add a RGBA color to google line chart

Demo Code

ResultView the demo in separate window

<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']});
      google.charts.setOnLoadCallback(drawChart);
      function drawChart() {/*from  w ww  .  j  av  a2 s . c om*/
        var data = google.visualization.arrayToDataTable([
          ['Year', 'Sales', 'Expenses'],
          ['2004',  1000,      400],
          ['2005',  1170,      460],
          ['2006',  660,       1120],
          ['2007',  1030,      540]
        ]);
        var options = {
          title: 'Company Performance',
          curveType: 'function',
          legend: { position: 'bottom' },
          backgroundColor:'transparent',
        };
        var chart = new google.visualization.LineChart(document.getElementById('curve_chart'));
        chart.draw(data, options);
      }
    
      </script> 
   </head> 
   <body> 
      <div id="curve_chart" style="width: 900px; height: 500px;background:rgba(0,0,0,0.7)"></div>  
   </body>
</html>

Related Tutorials