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
 
2411 robert 18
			$chartJS['legend'][$i] .= "	highlighter: { useXTickMarks: true,  ";
2113 robert 19
 
2411 robert 20
			$chartJS['legend'][$i] .= "		formatString: '<table><tr><td>%s, %s. ".$this->get_option('wpsg_currency')."</td></tr></table>'";
2113 robert 21
 
2331 robert 22
			$chartJS['legend'][$i] .= "	}";
2113 robert 23
 
2331 robert 24
			$chartJS['legend'][$i] .= "}";
2113 robert 25
 
2331 robert 26
			$j = 0;
27
 
28
			foreach ((array)$this->view['chart']['data'][$i]['records'] as $index => $record)
2113 robert 29
			{
2331 robert 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 (mktime(0, 0, 0, $record['month'], 1, $record['year']) <= mktime(0, 0, 0, date_i18n('m'), 1, date_i18n('Y')))
2331 robert 39
						{
2406 robert 40
							$chartJS['area']['area'.$i][] .= "['".$j."', ".wpsg_hspc($record['total'])."]";
41
						}
42
						$chartJS['ticks']['ticks'.$i][] = '['.$j.', \''.$record['tick'].'\']';
2331 robert 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(',', (array)$chartJS['area']['area'.$i]).']';
49
			  	}
50
 
51
			  	$j++;
52
			}
53
 
54
		}
2113 robert 55
 
2331 robert 56
	}
2406 robert 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 } ?>
2113 robert 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:{
2411 robert 98
        	  rendererOptions:{tickRenderer:
99
        		  jQuery.jqplot.CanvasAxisTickRenderer},
2113 robert 100
	          	label:'<?php echo wpsg_hspc($this->view['chart']['info']['xaxis']['label']); ?>',
2406 robert 101
	          	syncTicks: false,
102
	          	tickOptions:{formatString:'%d'},
103
	          	ticks: [<?php echo implode(',', $chartJS['ticks']['ticks0']); ?>]
104
	          	/*tickInterval: '1 month'
2331 robert 105
	          	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 106
	          	max:'<?php echo date('Y', $this->view['chart']['data'][0]['max']); ?>/<?php echo date('m', $this->view['chart']['data'][0]['max']); ?>/1'*/
2113 robert 107
	        },
108
	        yaxis:{
109
                label:'<?php echo wpsg_hspc($this->view['chart']['info']['yaxis']['label']); ?>',
110
                tickOptions: {
111
                	formatter: wpsg_statistics_number_format
112
            	},
113
        		min:0
114
            }
115
	      },
116
	      highlighter: {
117
	            show: true
118
	      }
119
	  });
120
 
121
	  wpsg_statistic_addExportButton();
122
 
123
});
124
</script>
125
<?php } else { ?>
126
<?php echo __('Keine Daten zur Auswertung vorhanden.', 'wpsg'); ?>
127
<?php } ?>