Currently I have the following code where I make the comparison of two data and I graph them in a bar graph, the problem is that the width of the bar is very thick and I want to reduce it, if I enter more data in said graph the width of the bar is reduced but if I leave only two the automatically increases and I would like it to stay the width of my preference, then the code:
<html>
<head>
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<script type="text/javascript">
google.charts.load('current', {'packages':['bar']});
google.charts.setOnLoadCallback(drawStuff);
function drawStuff() {
var data = new google.visualization.arrayToDataTable([
['Nombre', 'campo1', 'campo2'],
['Campo1 / Campo2', 50000, 20000]
/*['Enviados / Devueltos', 8000,7000],
['Enviados / Reenviados', 5600,3200],
['Enviados / Alcanzados', 4500,2600],
['Enviados / Devueltos', 1500,2500],*/
]);
var options = {
width: 700,
height: 400,
chart: {
title: 'Estado de las campañas',
subtitle: 'Estado de la campaña: '
},
bars: 'horizontal', // Required for Material Bar Charts.
series: {
0: { axis: 'brightness' }, // Bind series 0 to an axis named 'distance'. cambiado bright por brightness
1: { axis: 'brightness' } // Bind series 1 to an axis named 'brightness'.
},
axes: {
x: {
distance: {label: 'parsecs'}, // Bottom x-axis.
brightness: {side: 'top', label: 'Estado de las campañas'} // Top x-axis.
}
}
};
var chart = new google.charts.Bar(document.getElementById('dual_x_div'));
chart.draw(data, options);
};
</script>
</head>
<body>
<div id="dual_x_div"></div>
</body>
</html>
If I manipulate the following data:
var options = {
width: 700,
height: 400,
I can change the whole size of the graphic including the background, but I only want to change the width of the bars, which are not so thick. Thank you very much in advance.