Subversion Repositories php-qbpwcf

Rev

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

Rev Author Line No. Line
23 liveuser 1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
2
<html>
3
 
4
    <head>
5
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
6
        <title>amCharts examples</title>
7
        <link rel="stylesheet" href="style.css" type="text/css">
8
        <script src="../amcharts/amcharts.js" type="text/javascript"></script>
9
        <script src="../amcharts/pie.js" type="text/javascript"></script>
10
 
11
        <script>
12
            var chart;
13
 
14
            var chartData = [{
15
                "country": "Czech Republic",
16
                "litres": 301.9,
17
                "pattern": {
18
                    "url": "patterns/black/pattern1.png",
19
                    "width": 4,
20
                    "height": 4,
21
                    "color": "#cc0000"
22
                }
23
            }, {
24
                "country": "Ireland",
25
                "litres": 201.1,
26
                "pattern": {
27
                    "url": "patterns/black/pattern2.png",
28
                    "width": 4,
29
                    "height": 4
30
                }
31
            }, {
32
                "country": "Germany",
33
                "litres": 165.8,
34
                "pattern": {
35
                    "url": "patterns/black/pattern3.png",
36
                    "width": 4,
37
                    "height": 4
38
                }
39
            }, {
40
                "country": "Australia",
41
                "litres": 139.9,
42
                "pattern": {
43
                    "url": "patterns/black/pattern4.png",
44
                    "width": 4,
45
                    "height": 4
46
                }
47
            }, {
48
                "country": "Austria",
49
                "litres": 128.3,
50
                "pattern": {
51
                    "url": "patterns/black/pattern5.png",
52
                    "width": 4,
53
                    "height": 4
54
                }
55
            }, {
56
                "country": "UK",
57
                "litres": 99,
58
                "pattern": {
59
                    "url": "patterns/black/pattern6.png",
60
                    "width": 4,
61
                    "height": 4
62
                }
63
            }, {
64
                "country": "Belgium",
65
                "litres": 60,
66
                "pattern": {
67
                    "url": "patterns/black/pattern7.png",
68
                    "width": 4,
69
                    "height": 4
70
                }
71
            }];
72
 
73
            AmCharts.ready(function() {
74
                // PIE CHART
75
                chart = new AmCharts.AmPieChart();
76
 
77
                chart.dataProvider = chartData;
78
                chart.titleField = "country";
79
                chart.valueField = "litres";
80
                chart.patternField = "pattern";
81
                chart.outlineColor = "#000000";
82
                chart.outlineAlpha = 0.6;
83
                chart.balloonText = "[[title]]<br><span style='font-size:14px'><b>[[value]]</b> ([[percents]]%)</span>";
84
 
85
                var legend = new AmCharts.AmLegend();
86
                legend.markerBorderColor = "#000000";
87
                legend.switchType = undefined;
88
                legend.align = "center";
89
                chart.addLegend(legend);
90
 
91
                // WRITE
92
                chart.write("chartdiv");
93
            });
94
        </script>
95
    </head>
96
 
97
    <body>
98
        <div id="chartdiv" style="width: 100%; height: 400px;"></div>
99
    </body>
100
 
101
</html>