Subversion Repositories wpShopGermany4

Rev

Rev 5261 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
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] = "{";
13
 
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: {";
20
 
21
			$chartJS['legend'][$i] .= "		formatString: '<table><tr><td>%s, %s ".$this->get_option('wpsg_currency')."</td></tr></table>'";
22
 
23
			$chartJS['legend'][$i] .= "	}";
24
 
25
			$chartJS['legend'][$i] .= "}";
26
 
27
			$j = 0;
28
 
29
			foreach ((array)$this->view['chart']['data'][$i]['records'] as $index => $record)
30
			{
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 ($record['year'] <= date_i18n('Y'))
2331 robert 40
						{
41
							$chartJS['area']['area'.$i][] = "['".$rrecord['year'].'/'."1".'/'."1"."', ".wpsg_hspc($record['total'])."]";
42
						}
43
					}
44
					$k++;
45
				}
5945 hartmut 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
 
54
		}
2113 robert 55
 
2331 robert 56
	}
57
 
2113 robert 58
?>
59
 
2331 robert 60
<?php if ($chartJS['area'] != '') { ?>
2335 robert 61
<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 62
 
2350 robert 63
<br />
64
 
65
<div id="table-data">
66
	<?php $this->render(WPSG_PATH_VIEW.'/mods/mod_statistics/chartturnover/data.phtml'); ?>
67
</div>
68
 
69
<div class="wpsg_clearer"></div>
70
 
2113 robert 71
<script type="text/javascript">
72
 
73
function tooltipContentEditor(str, seriesIndex, pointIndex, plot) {
74
    // display series_label, x-axis_tick, y-axis value
75
    return plot.series[seriesIndex]["label"] + ", " + plot.data[seriesIndex][pointIndex];
76
}
77
 
78
 
79
jQuery(document).ready(function(){
2331 robert 80
	  <?php foreach ($chartJS['area'] as $index => $area) { ?>
81
		 var <?php echo $index; ?> = <?php echo $area; ?>;
82
	  <?php } ?>
5945 hartmut 83
 
2331 robert 84
	  var chartannualturnoverLine = jQuery.jqplot('chartannualturnover-line', [<?php echo implode(',', array_keys($chartJS['area'])); ?>], {
2113 robert 85
		  animate: true,
86
		  axesDefaults: {
87
	            labelRenderer: jQuery.jqplot.CanvasAxisLabelRenderer
88
		  },
89
		  series:[
90
          		<?php echo implode(', ', $chartJS['legend']); ?>
91
          ],
92
          legend: {
93
            show: true,
2304 robert 94
            placement: 'outside'
2113 robert 95
          },
96
	      axes:{
97
	        xaxis:{
98
	          	renderer:jQuery.jqplot.DateAxisRenderer,
99
	          	label:'<?php echo wpsg_hspc($this->view['chart']['info']['xaxis']['label']); ?>',
100
	          	tickOptions:{formatString:'%Y'},
101
	          	tickInterval: '1 year',
2331 robert 102
	          	min:'<?php echo date('Y', $this->view['chart']['data'][0]['min']); ?>/01/01',
103
	          	max:'<?php echo date('Y', $this->view['chart']['data'][0]['max']); ?>/01/01'
2113 robert 104
	        },
105
	        yaxis:{
106
                label:'<?php echo wpsg_hspc($this->view['chart']['info']['yaxis']['label']); ?>',
107
                tickOptions: {
108
                	formatter: wpsg_statistics_number_format
109
            	},
110
        		min:0
111
            }
112
	      },
113
	      highlighter: {
114
	            show: true
115
	      }
116
	  });
117
 
118
	  wpsg_statistic_addExportButton();
119
 
120
});
121
</script>
122
<?php } else { ?>
123
<?php echo __('Keine Daten zur Auswertung vorhanden.', 'wpsg'); ?>
124
<?php } ?>