to make the chart's background transparent,
use the following configuration option...
backgroundColor: 'transparent',
chartArea: {
backgroundColor: 'transparent',
}
to make the chart responsive,
re-draw the chart when the container's size changes,
such as on the window's resize event...
window.addEventListener('resize', function () {
chart.draw(data, options);
});
see following working snippet,
run the snippet, then click "Full page" to see it change...
note: the container <div>
has a cyan background
google.charts.load('current', {
packages: ['corechart']
}).then(function () {
var data = google.visualization.arrayToDataTable([
['x', 'y'],
[0, 0],
[1, 1],
[2, 2],
[3, 3],
[4, 4],
[5, 5]
]);
var options = {
backgroundColor: 'transparent',
chartArea: {
backgroundColor: 'transparent',
}
};
var chart = new google.visualization.LineChart(document.getElementById('chart_div'));
chart.draw(data, options);
window.addEventListener('resize', function () {
chart.draw(data, options);
});
});
#chart_div {
background-color: cyan;
}
<script src="https://www.gstatic.com/charts/loader.js"></script>
<div id="chart_div"></div>