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/serial.js" type="text/javascript"></script>
10
 
11
        <script>
12
            var chart;
13
 
14
            var chartData = [
15
                {
16
                    "continent": "North America",
17
                    "trucks": 40000,
18
                    "SUVs": 180000,
19
                    "cars": 90000,
20
                    "total": 310000
21
                },
22
                {
23
                    "continent": "Asia",
24
                    "trucks": 90000,
25
                    "SUVs": 40000,
26
                    "cars": 110000,
27
                    "total": 240000
28
                },
29
                {
30
                    "continent": "Europe",
31
                    "trucks": 30000,
32
                    "SUVs": 50000,
33
                    "cars": 110000,
34
                    "total": 190000
35
                }
36
            ];
37
 
38
            AmCharts.ready(function () {
39
                // SERIAL CHART
40
                chart = new AmCharts.AmSerialChart();
41
                chart.dataProvider = chartData;
42
                chart.categoryField = "continent";
43
                chart.plotAreaBorderAlpha = 0.2;
44
 
45
                // AXES
46
                // category
47
                var categoryAxis = chart.categoryAxis;
48
                categoryAxis.gridAlpha = 0.1;
49
                categoryAxis.axisAlpha = 0;
50
                categoryAxis.widthField = "total";
51
                categoryAxis.gridPosition = "start";
52
 
53
                // value
54
                var valueAxis = new AmCharts.ValueAxis();
55
                valueAxis.stackType = "100% stacked";
56
                valueAxis.gridAlpha = 0.1;
57
                valueAxis.unit = "%";
58
                valueAxis.axisAlpha = 0;
59
                chart.addValueAxis(valueAxis);
60
 
61
 
62
                // GRAPHS
63
                // first graph
64
                var graph = new AmCharts.AmGraph();
65
                graph.title = "Trucks";
66
                graph.labelText = "[[value]]";
67
                graph.valueField = "trucks";
68
                graph.type = "column";
69
                graph.fillAlphas = 1;
70
                chart.addGraph(graph);
71
 
72
                // second graph
73
                graph = new AmCharts.AmGraph();
74
                graph.title = "SUVs";
75
                graph.labelText = "[[value]]";
76
                graph.valueField = "SUVs";
77
                graph.type = "column";
78
                graph.fillAlphas = 1;
79
                chart.addGraph(graph);
80
 
81
                // third graph
82
                graph = new AmCharts.AmGraph();
83
                graph.title = "Cars";
84
                graph.labelText = "[[value]]";
85
                graph.valueField = "cars";
86
                graph.type = "column";
87
                graph.fillAlphas = 1;
88
                chart.addGraph(graph);
89
 
90
                chart.legend = new AmCharts.AmLegend();
91
 
92
 
93
                // WRITE
94
                chart.write("chartdiv");
95
            });
96
 
97
        </script>
98
    </head>
99
 
100
    <body>
101
        <div id="chartdiv" style="width: 600px; height: 400px;"></div>
102
    </body>
103
 
104
</html>