Subversion Repositories wpShopGermany4

Rev

Rev 4943 | Go to most recent revision | 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
	{
7
 
8
		for ($i = 0; $i < count($this->view['chart']['data']); $i++)
2113 robert 9
		{
10
 
2331 robert 11
			$chartJS['legend'][$i] = "{";
12
 
13
			if (isset($this->view['chart']['data'][$i]['label']))
2113 robert 14
			{
2331 robert 15
				$chartJS['legend'][$i] .= "label:'".$this->view['chart']['data'][$i]['label']."',";
2113 robert 16
			}
17
 
2331 robert 18
			$chartJS['legend'][$i] .= "	highlighter: {";
19
 
20
			$chartJS['legend'][$i] .= "		formatString: '<table><tr><td>%s, %s ".$this->get_option('wpsg_currency')."</td></tr></table>'";
21
 
22
			$chartJS['legend'][$i] .= "	}";
23
 
24
			$chartJS['legend'][$i] .= "}";
25
 
26
			$j = 0;
27
 
28
			foreach ((array)$this->view['chart']['data'][$i]['records'] as $index => $record)
29
			{
30
 
31
				//immer das Datum vom Rootelement nutzen
32
				$k = 0 ;
33
 
34
				foreach ($this->view['chart']['data'][0]['records'] as $rindex => $rrecord)
35
				{
36
					if ($j == $k)
37
					{
2486 robert 38
						if ($record['year'] <= date_i18n('Y'))
2331 robert 39
						{
40
							$chartJS['area']['area'.$i][] = "['".$rrecord['year'].'/'."1".'/'."1"."', ".wpsg_hspc($record['total'])."]";
41
						}
42
					}
43
					$k++;
44
				}
45
 
46
				if ($j == count($this->view['chart']['data'][$i]['records']) - 1) {
47
			  		$chartJS['area']['area'.$i] = '['.implode(',', $chartJS['area']['area'.$i]).']';
48
			  	}
49
 
50
			  	$j++;
51
			}
52
 
53
		}
2113 robert 54
 
2331 robert 55
	}
56
 
2113 robert 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
function tooltipContentEditor(str, seriesIndex, pointIndex, plot) {
73
    // display series_label, x-axis_tick, y-axis value
74
    return plot.series[seriesIndex]["label"] + ", " + plot.data[seriesIndex][pointIndex];
75
}
76
 
77
 
78
jQuery(document).ready(function(){
2331 robert 79
	  <?php foreach ($chartJS['area'] as $index => $area) { ?>
80
		 var <?php echo $index; ?> = <?php echo $area; ?>;
81
	  <?php } ?>
2113 robert 82
 
2331 robert 83
	  var chartannualturnoverLine = jQuery.jqplot('chartannualturnover-line', [<?php echo implode(',', array_keys($chartJS['area'])); ?>], {
2113 robert 84
		  animate: true,
85
		  axesDefaults: {
86
	            labelRenderer: jQuery.jqplot.CanvasAxisLabelRenderer
87
		  },
88
		  series:[
89
          		<?php echo implode(', ', $chartJS['legend']); ?>
90
          ],
91
          legend: {
92
            show: true,
2304 robert 93
            placement: 'outside'
2113 robert 94
          },
95
	      axes:{
96
	        xaxis:{
97
	          	renderer:jQuery.jqplot.DateAxisRenderer,
98
	          	label:'<?php echo wpsg_hspc($this->view['chart']['info']['xaxis']['label']); ?>',
99
	          	tickOptions:{formatString:'%Y'},
100
	          	tickInterval: '1 year',
2331 robert 101
	          	min:'<?php echo date('Y', $this->view['chart']['data'][0]['min']); ?>/01/01',
102
	          	max:'<?php echo date('Y', $this->view['chart']['data'][0]['max']); ?>/01/01'
2113 robert 103
	        },
104
	        yaxis:{
105
                label:'<?php echo wpsg_hspc($this->view['chart']['info']['yaxis']['label']); ?>',
106
                tickOptions: {
107
                	formatter: wpsg_statistics_number_format
108
            	},
109
        		min:0
110
            }
111
	      },
112
	      highlighter: {
113
	            show: true
114
	      }
115
	  });
116
 
117
	  wpsg_statistic_addExportButton();
118
 
119
});
120
</script>
121
<?php } else { ?>
122
<?php echo __('Keine Daten zur Auswertung vorhanden.', 'wpsg'); ?>
123
<?php } ?>