I'm trying to use Google charts in my Birt report. I have added a text and set it to display as html. Now I need to loop through the data set or data cube and to create an array like in var data. I'm just not sure how to do that or if that is the right way to do it. I have tried to look for a foreach looping through a data set or cube but have not found any. I have bound the data set to the text. I have also included the report and the csv data file.
Thanks for your help.
google.charts.load('current', {packages: ['corechart', 'bar']});
google.charts.setOnLoadCallback(drawBasic);
function drawBasic() {
var data = google.visualization.arrayToDataTable([
['City', '2010 Population',],
['New York City, NY', 8175000],
['Los Angeles, CA', 3792000],
['Chicago, IL', 2695000],
['Houston, TX', 2099000],
['Philadelphia, PA', 1526000]
]);
var options = {
title: 'Population of Largest U.S. Cities',
chartArea: {width: '50%'},
hAxis: {
title: 'Total Population',
minValue: 0
},
vAxis: {
title: 'City'
}
};
var chart = new google.visualization.BarChart(document.getElementById('chart_div'));
chart.draw(data, options);
}