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