I'm trying to draw a barchart with chart range filter with the script and code bellow, but i'm getting 2 errors 1-One or more participants failed to draw()× 2-The filter cannot operate on a column of type string. Column type must be one of: number, date, datetime or timeofday. Column role must be domain, and correlate to a continuous axis
for the second error, the data is clear as you see in the code below
<div id="dashboard" class="container-fluid" style="height:100%">
<div id="chart_div" style="height:99%"></div>
<div id="filter-range" style="height:1%"></div>
</div>
<script type="text/javascript">
google.charts.load('current', { packages: ['corechart', 'controls'] });
google.charts.setOnLoadCallback(drawChart);
function drawChart() {
var data = google.visualization.arrayToDataTable([
['Name', 'Donuts eaten', 'Donuts eaten'],
['Michael', 5, 6],
['Elisa', 7, 6],
['Robert', 3, 7],
['John', 2, 8],
['Jessica', 6, 9],
['Aaron', 1, 20],
['Margareth', 8, 8]
]);
var rangeFilter = new google.visualization.ControlWrapper({
controlType: 'ChartRangeFilter',
containerId: 'filter-range',
options: {
filterColumnIndex: 0,
ui: {
chartType: 'ColumnChart',
chartOptions: {
height: 40,
colors: ['#ff7900', '#50be87'],
chartArea: {
width: '100%',
height: '100%',
top: 0,
left: 0,
right: 0,
bottom: 0
}
}
}
}
});
var chart = new google.visualization.ChartWrapper({
chartType: 'ColumnChart',
containerId: 'chart_div',
options: {
width: '100%',
height: 450,
legend: {
alignment: 'end',
position: 'top'
},
animation: {
duration: 500,
easing: 'in',
startup: true
},
chartArea: {
top: 36,
left: 36,
right: 18,
bottom: 36
},
isStacked: true,
bar: { groupWidth: '95%' },
colors: ['#ff7900', '#50be87']
}
});
var dashboard = new google.visualization.Dashboard(document.getElementById('dashboard'));
dashboard.bind(rangeFilter, chart);
dashboard.draw(data);
}
</script>```