27 lines
1005 B
HTML
27 lines
1005 B
HTML
<?php foreach($reklams as $id => $reklam):?>
|
|
<div
|
|
class="tab-pane active"
|
|
id="curve_chart_<?=$id?>" style="width:100%; height:400px; margin-top: 10px;">
|
|
</div>
|
|
<script>
|
|
google.charts.load('current', {'packages':['corechart']});
|
|
google.charts.setOnLoadCallback(drawLineChart_<?=$id?>);
|
|
|
|
function drawLineChart_<?=$id?>(){
|
|
var data = google.visualization.arrayToDataTable([
|
|
['date', 'views', 'clicks',],
|
|
<?php foreach($reklam_stats->where('item_id',$id) as $stats):?>
|
|
['<?=date_format(date_create($stats->date),'m/d')?>', <?=$stats->view?>,<?=$stats->click?>],
|
|
<?php endforeach; ?>
|
|
]);
|
|
var options = {
|
|
title: '<?=$reklam?>',
|
|
curveType: 'function',
|
|
legend: { position: 'bottom' }
|
|
};
|
|
var curve_chart = new google.visualization.LineChart(document.getElementById('curve_chart_<?=$id?>'));
|
|
curve_chart.draw(data, options);
|
|
}
|
|
</script>
|
|
<?php endforeach;?>
|