Statistics
| Revision:

root / module / Aktien / views / Info / header.php @ 61

History | View | Annotate | Download (1.9 kB)

1
<?php
2
/* 
3
    get the globals below from basedir > index.php
4
*/
5
global $chartColor, $chartColors, $chartSecondColors;
6

    
7
$chart = "<script type=\"text/javascript\">
8
function renderchart()
9
{
10
    jQuery.get('/Aktien/Chart?firma=" . $this->firma->fid . "', function(strdata, textStatus)
11
        {
12
            var splitdata = strdata.split(\"|\");
13

14
            var d2 = [];
15

16
            jmax=splitdata.length;
17
            for(var j=0; j < jmax; j++){
18
                var vardate = splitdata[j].split(\",\");
19
                d2.push([vardate[0], vardate[1]]);
20
            }
21
            $.plot($('#chart'),
22
            [{ 
23
            label: '" . $this->firma->name . "',
24
            data: d2, 
25
            lines: { show: true, lineWidth: 2.5, fill: 0.4, fillColor: { colors: [ { opacity: 0.8 }, { opacity: 0.1 } ] }, shadowSize: 0 },
26
            color: '#" . Config::get('chartcolor1') . "'
27
            }],
28
         { xaxis: { mode: 'time' },
29
             yaxis: { min: 0, autoscaleMargin:1 },
30
             grid: { 
31
             borderWidth: 2, 
32
             borderColor: '#" . Config::get('chartcolor2') . "',
33
             color: '#" . Config::get('chartcolor2') . "',
34
             backgroundColor: { colors: ['#" . Config::get('chartcolor3') . "', '#" . Config::get('chartcolor2') . "']  }
35
        },
36
            legend: { show: false, position: 'ne' } });
37
        var now = new Date();
38
        var Std = now.getHours();
39
        var Min = now.getMinutes();
40
        var Sec = now.getSeconds();
41
        var StdAusgabe = ((Std < 10) ? '0' + Std : Std);
42
        var MinAusgabe = ((Min < 10) ? '0' + Min : Min);
43
        var SecAusgabe = ((Sec < 10) ? '0' + Sec : Sec);
44
        jQuery('#update').html(StdAusgabe+':'+MinAusgabe+':'+SecAusgabe);
45
                setTimeout('renderchart();', 1000); // refresh chart every 1second
46
            }
47
        );
48
}
49
</script>";
50
return $chart;