2113 |
robert |
1 |
<?php $this->render(WPSG_PATH_VIEW.'/mods/mod_statistics/simplefilter.phtml'); ?>
|
|
|
2 |
|
|
|
3 |
<?php
|
|
|
4 |
|
2331 |
robert |
5 |
if (wpsg_isSizedArray($this->view['chart']['data']))
|
|
|
6 |
{
|
5945 |
hartmut |
7 |
unset($this->view['chart']['data']['template']);
|
2331 |
robert |
8 |
|
|
|
9 |
for ($i = 0; $i < count($this->view['chart']['data']); $i++)
|
2113 |
robert |
10 |
{
|
|
|
11 |
|
2331 |
robert |
12 |
$chartJS['legend'][$i] = "{";
|
2113 |
robert |
13 |
|
2331 |
robert |
14 |
if (isset($this->view['chart']['data'][$i]['label']))
|
2113 |
robert |
15 |
{
|
2331 |
robert |
16 |
$chartJS['legend'][$i] .= "label:'".$this->view['chart']['data'][$i]['label']."',";
|
2113 |
robert |
17 |
}
|
|
|
18 |
|
2331 |
robert |
19 |
$chartJS['legend'][$i] .= " highlighter: {";
|
2113 |
robert |
20 |
|
5945 |
hartmut |
21 |
$chartJS['legend'][$i] .= " formatString: '<table><tr><td>%s ".wpsg_getStr($this->view['chart']['data'][$i]['year']).", %s ".$this->get_option('wpsg_currency')."</td></tr></table>'";
|
2113 |
robert |
22 |
|
2331 |
robert |
23 |
$chartJS['legend'][$i] .= " }";
|
2113 |
robert |
24 |
|
2331 |
robert |
25 |
$chartJS['legend'][$i] .= "}";
|
2113 |
robert |
26 |
|
2331 |
robert |
27 |
$j = 0;
|
|
|
28 |
|
|
|
29 |
foreach ((array)$this->view['chart']['data'][$i]['records'] as $index => $record)
|
2113 |
robert |
30 |
{
|
2331 |
robert |
31 |
|
|
|
32 |
//immer das Datum vom Rootelement nutzen
|
|
|
33 |
$k = 0 ;
|
|
|
34 |
|
|
|
35 |
foreach ($this->view['chart']['data'][0]['records'] as $rindex => $rrecord)
|
|
|
36 |
{
|
|
|
37 |
if ($j == $k)
|
|
|
38 |
{
|
2486 |
robert |
39 |
if (mktime(0, 0, 0, $record['month'], $record['day'], $record['year']) <= mktime(0, 0, 0, date_i18n('m'), date_i18n('d'), date_i18n('Y')))
|
2331 |
robert |
40 |
{
|
|
|
41 |
$chartJS['area']['area'.$i][] = "['".$rrecord['year'].'/'.$rrecord['month'].'/'.$rrecord['day']."', ".wpsg_hspc($record['total'])."]";
|
|
|
42 |
}
|
|
|
43 |
}
|
|
|
44 |
$k++;
|
|
|
45 |
}
|
2113 |
robert |
46 |
|
2331 |
robert |
47 |
if ($j == count($this->view['chart']['data'][$i]['records']) - 1) {
|
|
|
48 |
$chartJS['area']['area'.$i] = '['.implode(',', $chartJS['area']['area'.$i]).']';
|
|
|
49 |
}
|
|
|
50 |
|
|
|
51 |
$j++;
|
|
|
52 |
}
|
|
|
53 |
|
2113 |
robert |
54 |
}
|
|
|
55 |
|
|
|
56 |
}
|
|
|
57 |
|
|
|
58 |
?>
|
2331 |
robert |
59 |
<?php if ($chartJS['area'] != '') { ?>
|
2335 |
robert |
60 |
<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>
|
2113 |
robert |
61 |
|
2350 |
robert |
62 |
<br />
|
|
|
63 |
|
|
|
64 |
<div id="table-data">
|
|
|
65 |
<?php $this->render(WPSG_PATH_VIEW.'/mods/mod_statistics/chartturnover/data.phtml'); ?>
|
|
|
66 |
</div>
|
|
|
67 |
|
|
|
68 |
<div class="wpsg_clearer"></div>
|
|
|
69 |
|
2113 |
robert |
70 |
<script type="text/javascript">
|
|
|
71 |
|
|
|
72 |
|
|
|
73 |
jQuery(document).ready(function(){
|
2331 |
robert |
74 |
<?php foreach ($chartJS['area'] as $index => $area) { ?>
|
|
|
75 |
var <?php echo $index; ?> = <?php echo $area; ?>;
|
|
|
76 |
<?php } ?>
|
5945 |
hartmut |
77 |
|
2331 |
robert |
78 |
var chartannualturnoverLine = jQuery.jqplot('chartannualturnover-line', [<?php echo implode(',', array_keys($chartJS['area'])); ?>], {
|
2113 |
robert |
79 |
animate: true,
|
|
|
80 |
axesDefaults: {
|
|
|
81 |
labelRenderer: jQuery.jqplot.CanvasAxisLabelRenderer
|
|
|
82 |
},
|
|
|
83 |
series:[
|
|
|
84 |
<?php echo implode(', ', $chartJS['legend']); ?>
|
|
|
85 |
],
|
|
|
86 |
legend: {
|
|
|
87 |
show: true,
|
2304 |
robert |
88 |
placement: 'outside'
|
2113 |
robert |
89 |
},
|
|
|
90 |
axes:{
|
|
|
91 |
xaxis:{
|
|
|
92 |
renderer:jQuery.jqplot.DateAxisRenderer,
|
5945 |
hartmut |
93 |
label:'<?php echo wpsg_hspc(wpsg_getStr($this->view['chart']['info']['xaxis']['label'])); ?>',
|
|
|
94 |
label:'<?php echo wpsg_hspc(wpsg_getStr($this->view['chart']['data'][0]['label'])); ?>',
|
2113 |
robert |
95 |
tickOptions:{formatString:'%d'},
|
|
|
96 |
tickInterval: '1 day',
|
2331 |
robert |
97 |
min:'<?php echo date('Y', $this->view['chart']['data'][0]['min']); ?>/<?php echo date('m', $this->view['chart']['data'][0]['min']); ?>/<?php echo date('d', $this->view['chart']['data'][0]['min']); ?>',
|
|
|
98 |
max:'<?php echo date('Y', $this->view['chart']['data'][0]['max']); ?>/<?php echo date('m', $this->view['chart']['data'][0]['max']); ?>/<?php echo date('d', $this->view['chart']['data'][0]['max']); ?>'
|
2113 |
robert |
99 |
},
|
|
|
100 |
yaxis:{
|
|
|
101 |
label:'<?php echo wpsg_hspc($this->view['chart']['info']['yaxis']['label']); ?>',
|
|
|
102 |
tickOptions: {
|
|
|
103 |
formatter: wpsg_statistics_number_format
|
|
|
104 |
},
|
|
|
105 |
min:0
|
|
|
106 |
}
|
|
|
107 |
},
|
|
|
108 |
highlighter: {
|
|
|
109 |
show: true
|
|
|
110 |
}
|
|
|
111 |
});
|
|
|
112 |
|
|
|
113 |
wpsg_statistic_addExportButton();
|
|
|
114 |
|
|
|
115 |
});
|
|
|
116 |
</script>
|
|
|
117 |
<?php } else { ?>
|
|
|
118 |
<?php echo __('Keine Daten zur Auswertung vorhanden.', 'wpsg'); ?>
|
|
|
119 |
<?php } ?>
|