I am attempting to get all of the items in my app that were created last week as a table to display on a report page on my companies internal website. In the end I would like to take this data and build charts with it in googles charts API.
below I have the example html and JavaScritp code for the google charts. This is working but I would like to display each of the gathered PodioItem::filter objcects as a table with all respective columns shown in the app on podio.com
$exampleCompany1_this_week = PodioItem::filter($app_id,array('limit' => 500, 'filters'=>array($company_id=>'exampleCompany1',$createdDate_id => $thisweek )));
$exampleCompany1_last_week = PodioItem::filter($app_id,array('limit' => 500, 'filters'=>array($company_id=>'exampleCompany1',$createdDate_id => $lastweek )));
$exampleCompany2_this_week = PodioItem::filter($app_id,array('limit' => 500, 'filters'=>array($company_id=>'exampleCompany2',$createdDate_id => $thisweek )));
$exampleCompany2_last_week = PodioItem::filter($app_id,array('limit' => 500, 'filters'=>array($company_id=>'exampleCompany2',$createdDate_id => $lastweek )));
$exampleCompany3_this_week = PodioItem::filter($app_id,array('limit' => 500, 'filters'=>array($company_id=>'exampleCompany3',$createdDate_id => $thisweek )));
$exampleCompany3_last_week = PodioItem::filter($app_id,array('limit' => 500, 'filters'=>array($company_id=>'exampleCompany3',$createdDate_id => $lastweek )));
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<div class = "container">
<div class = "wrapper">
<center><h1>KPI Podio Reports</h1></center>
</div>
<div class="data">
<form action="index.php" method=POST">
<center><div id="dual_x_div" style="width: 900px; height: 500px;"></div></center>
<script type="text/javascript" >
google.charts.load('current', {'packages':['bar']});
google.charts.setOnLoadCallback(drawStuff);
function drawStuff() {
var data = new google.visualization.arrayToDataTable([
['Company', 'This Week', 'Last Week'],
['exampleCompany1', <?php echo count($exampleCompany1_this_week) ?>, <?php echo count($exampleCompany1_last_week) ?>],
['exampleCompany2', <?php echo count($exampleCompany2_this_week)?>,<?php echo count($exampleCompany2_last_week)?>],
['exampleCompany3', <?php echo count($exampleCompany3_this_week)?>, <?php echo count($exampleCompany3_last_week)?>]
]);
var options = {
width: 750,
chart: {
title: 'New Solar Projects',
subtitle: 'Number of New Projects by Company'
},
bars: 'Vertical', // Required for Material Bar Charts.
axes: {
x: {
distance: {label: 'Projects'}, // Bottom x-axis.
}
}
};
var chart = new google.charts.Bar(document.getElementById('dual_x_div'));
chart.draw(data, options);
};
</script>