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
        <script>
11
            var chart;
12
 
13
            var chartData = [
14
                {
15
                    "year": 2005,
16
                    "income": 23.5,
17
                    "expenses": 18.1
18
                },
19
                {
20
                    "year": 2006,
21
                    "income": 26.2,
22
                    "expenses": 22.8
23
                },
24
                {
25
                    "year": 2007,
26
                    "income": 30.1,
27
                    "expenses": 23.9
28
                },
29
                {
30
                    "year": 2008,
31
                    "income": 29.5,
32
                    "expenses": 25.1
33
                },
34
                {
35
                    "year": 2009,
36
                    "income": 24.6,
37
                    "expenses": 25
38
                }
39
            ];
40
 
41
 
42
            AmCharts.ready(function () {
43
                // SERIAL CHART
44
                chart = new AmCharts.AmSerialChart();
45
                chart.dataProvider = chartData;
46
                chart.categoryField = "year";
47
                chart.startDuration = 1;
48
                chart.rotate = true;
49
 
50
                // AXES
51
                // category
52
                var categoryAxis = chart.categoryAxis;
53
                categoryAxis.gridPosition = "start";
54
                categoryAxis.axisColor = "#DADADA";
55
                categoryAxis.dashLength = 3;
56
 
57
                // value
58
                var valueAxis = new AmCharts.ValueAxis();
59
                valueAxis.dashLength = 3;
60
                valueAxis.axisAlpha = 0.2;
61
                valueAxis.position = "top";
62
                valueAxis.title = "Million USD";
63
                valueAxis.minorGridEnabled = true;
64
                valueAxis.minorGridAlpha = 0.08;
65
                valueAxis.gridAlpha = 0.15;
66
                chart.addValueAxis(valueAxis);
67
 
68
                // GRAPHS
69
                // column graph
70
                var graph1 = new AmCharts.AmGraph();
71
                graph1.type = "column";
72
                graph1.title = "Income";
73
                graph1.valueField = "income";
74
                graph1.lineAlpha = 0;
75
                graph1.fillColors = "#ADD981";
76
                graph1.fillAlphas = 0.8;
77
                graph1.balloonText = "<span style='font-size:13px;'>[[title]] in [[category]]:<b>[[value]]</b></span>";
78
                chart.addGraph(graph1);
79
 
80
                // line graph
81
                var graph2 = new AmCharts.AmGraph();
82
                graph2.type = "line";
83
                graph2.lineColor = "#27c5ff";
84
                graph2.bulletColor = "#FFFFFF";
85
                graph2.bulletBorderColor = "#27c5ff";
86
                graph2.bulletBorderThickness = 2;
87
                graph2.bulletBorderAlpha = 1;
88
                graph2.title = "Expenses";
89
                graph2.valueField = "expenses";
90
                graph2.lineThickness = 2;
91
                graph2.bullet = "round";
92
                graph2.fillAlphas = 0;
93
                graph2.balloonText = "<span style='font-size:13px;'>[[title]] in [[category]]:<b>[[value]]</b></span>";
94
                chart.addGraph(graph2);
95
 
96
                // LEGEND
97
                var legend = new AmCharts.AmLegend();
98
                legend.useGraphSettings = true;
99
                chart.addLegend(legend);
100
 
101
                chart.creditsPosition = "top-right";
102
 
103
                // WRITE
104
                chart.write("chartdiv");
105
            });
106
        </script>
107
    </head>
108
 
109
    <body>
110
        <div id="chartdiv" style="width: 500px; height: 600px;"></div>
111
    </body>
112
 
113
</html>