1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 | <?php if ($dimension_properties): ?> <div class="owa_reportSectionContent"> <?php echo $this->renderDimension($dimension_template, $dimension_properties);?> </div> <?php endif;?> <div class="owa_reportSectionContent"> <div id="trend-chart" style="height:125px;width:auto;"></div> <div id="trend-title" class="owa_reportHeadline"></div> <div id="report-tabs"> <?php foreach ($tabs as $k => $tab): ?> <div id="tab_<?php $this->out($k); ?>"> <div id="<?php $this->out($k); ?>_trend-metrics" style="height:auto;width:auto;<?php if($pie) {echo 'float:right';}?>"></div> <?php if($pie): ?> <div id="pie" style="min-width:300px;"></div> <?php endif;?> <div class="spacer" style="clear:both; height:20px;"></div> <?php if (!$this->get('hideGrid')):?> <div id="<?php $this->out($k); ?>_dimension-grid"></div> <?php endif;?> </div> <?php endforeach; ?> </div> </div> <script> // add tabs <?php foreach ($tabs as $k => $tab): ?> var tab = new OWA.report.tab('tab_<?php $this->out($k, false);?>'); tab.setLabel('<?php $this->out($tab['tab_label']);?>'); // create trend and aggregate data resultSetExplorer objects var trendurl = '<?php echo $this->makeApiLink(array('do' => 'getResultSet', 'metrics' => $tab['metrics'], 'dimensions' => 'date', 'sort' => 'date', 'format' => 'json', 'constraints' => $constraints ),true);?>'; var trend = new OWA.resultSetExplorer('trend-chart'); trend.setDataLoadUrl(trendurl); trend.options.sparkline.metric = 'visits'; <?php if ($trendTitle):?> trend.asyncQueue.push(['renderTemplate', '<?php echo $trendTitle;?>', {d: trend}, 'replace', 'trend-title']); <?php endif;?> trend.asyncQueue.push(['makeAreaChart', [{x: 'date', y: '<?php echo $trendChartMetric; ?>'}], 'trend-chart']); trend.options.metricBoxes.width = '150px'; trend.asyncQueue.push(['makeMetricBoxes' , '<?php $this->out($k, false);?>_trend-metrics']); tab.addRse('trend', trend); OWA.items['<?php echo $dom_id;?>'].addTab( tab ); <?php endforeach;?> // create report tabs OWA.items['<?php echo $dom_id;?>'].createTabs(); </script> <?php require_once('js_report_templates.php');?> |