I am trying to embed google line chart in a client's website, which will be generated on basis of some php variables in run-time. The issue that I am facing is, the chart's parent's background ( on which the chart is kept) that I am using is in rgba(0,0,0,.7) format, which gives a transparent feel to the background not to the content, and the background that google api gives is a white one, I tried to change the color of the background, but it accepts hex values "#000", which do not provide transparency. Can anyone suggest a way to give a rgba() as color to google chart. Sorry I cannot share the exact code, but the below can be taken as reference.
<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() {
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:'#000';
};
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"></div>
</body>
</html>
I went through this and this but cannot find an answer to my question. Please suggest a simple way out.