summaryrefslogtreecommitdiff
path: root/views/mods/mod_statistics/chartturnover/customrange.phtml
diff options
context:
space:
mode:
Diffstat (limited to 'views/mods/mod_statistics/chartturnover/customrange.phtml')
-rw-r--r--views/mods/mod_statistics/chartturnover/customrange.phtml112
1 files changed, 112 insertions, 0 deletions
diff --git a/views/mods/mod_statistics/chartturnover/customrange.phtml b/views/mods/mod_statistics/chartturnover/customrange.phtml
new file mode 100644
index 0000000..3f046ae
--- /dev/null
+++ b/views/mods/mod_statistics/chartturnover/customrange.phtml
@@ -0,0 +1,112 @@
+<?php $this->render(WPSG_PATH_VIEW.'/mods/mod_statistics/simplefilter.phtml'); ?>
+
+<?php
+
+ if (wpsg_isSizedArray($this->view['chart']['data']['records'])) {
+
+ $i = 0;
+ $j = 0;
+
+ foreach ($this->view['chart']['data']['records'] as $data)
+ {
+
+ $series = "{";
+
+ if (isset($this->view['chart']['data']['label']))
+ {
+ $series .= "label:'".$this->view['chart']['data']['label'].' '.$data['year']."',";
+ }
+ else
+ {
+ $series .= "label:'".date_i18n('F', strtotime($data['day'].'.'.$data['month'].'.'.$data['year'])).' '.$data['year']."', ";
+ }
+
+ $series .= " highlighter: {";
+
+ $series .= " formatString: '<table><tr><td>%s ".$data['month']." ".$data['year'].", %s. ".$this->get_option('wpsg_currency')."</td></tr></table>'";
+
+ $series .= " }";
+
+ $series .= "}";
+
+ if (!in_array($series, (array)$chartJS['legend']) || !isset($chartJS['legend'][$i]))
+ {
+ $chartJS['legend'][$i] = $series;
+ }
+
+ $chartJS['year'] .= "['".$data['year'].'/'.$data['month'].'/'."1"."', ".wpsg_hspc($data['total'])."], ";
+
+ if ($j == count($this->view['chart']['data']['records']) - 1) {
+ $chartJS['year'] = 'var year = ['.substr($chartJS['year'], 0, -2).'];';
+ }
+
+ $j++;
+
+ }
+
+ }
+?>
+
+<?php if ($chartJS['year'] != '') { ?>
+<div id="chartannualturnover-line" style="height:<?php echo $this->get_option('wpsg_mod_statistics_line_chart_height'); ?>px; width:<?php echo $this->get_option('wpsg_mod_statistics_line_chart_width'); ?>px;"></div>
+
+<br />
+
+<div id="table-data">
+ <?php $this->render(WPSG_PATH_VIEW.'/mods/mod_statistics/chartturnover/data.phtml'); ?>
+</div>
+
+<div class="wpsg_clearer"></div>
+
+<script type="text/javascript">
+
+function tooltipContentEditor(str, seriesIndex, pointIndex, plot) {
+ // display series_label, x-axis_tick, y-axis value
+ return plot.series[seriesIndex]["label"] + ", " + plot.data[seriesIndex][pointIndex];
+}
+
+
+jQuery(document).ready(function(){
+ <?php echo $chartJS['year']; ?>
+
+ var chartannualturnoverLine = jQuery.jqplot('chartannualturnover-line', [year], {
+ animate: true,
+ axesDefaults: {
+ labelRenderer: jQuery.jqplot.CanvasAxisLabelRenderer
+ },
+ series:[
+ <?php echo implode(', ', $chartJS['legend']); ?>
+ ],
+ legend: {
+ show: true,
+ placement: 'outside'
+ },
+ axes:{
+ xaxis:{
+ renderer:jQuery.jqplot.DateAxisRenderer,
+ label:'<?php echo wpsg_hspc($this->view['chart']['info']['xaxis']['label']); ?>',
+ tickOptions:{formatString:'%b'},
+ tickInterval: '1 month',
+ min:'<?php echo date('Y', $this->view['chart']['data']['min']); ?>/<?php echo date('m', $this->view['chart']['data']['min']); ?>/<?php echo date('d', $this->view['chart']['data']['min']); ?>',
+ max:'<?php echo date('Y', $this->view['chart']['data']['max']); ?>/<?php echo date('m', $this->view['chart']['data']['max']); ?>/<?php echo date('d', $this->view['chart']['data']['max']); ?>'
+ },
+ yaxis:{
+ label:'<?php echo wpsg_hspc($this->view['chart']['info']['yaxis']['label']); ?>',
+ tickOptions: {
+ formatter: wpsg_statistics_number_format
+ },
+ min:0
+ }
+ },
+ highlighter: {
+ show: true
+ }
+ });
+
+ wpsg_statistic_addExportButton();
+
+});
+</script>
+<?php } else { ?>
+<?php echo __('Keine Daten zur Auswertung vorhanden.', 'wpsg'); ?>
+<?php } ?> \ No newline at end of file