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
            var chartData = [
14
                {
15
                    "year": 2009,
16
                    "income": 23.5,
17
                    "expenses": 18.1
18
                },
19
                {
20
                    "year": 2010,
21
                    "income": 26.2,
22
                    "expenses": 22.8
23
                },
24
                {
25
                    "year": 2011,
26
                    "income": 30.1,
27
                    "expenses": 23.9
28
                },
29
                {
30
                    "year": 2012,
31
                    "income": 29.5,
32
                    "expenses": 25.1
33
                },
34
                {
35
                    "year": 2013,
36
                    "income": 30.6,
37
                    "expenses": 27.2,
38
                    "dashLengthLine": 5
39
                },
40
                {
41
                    "year": 2014,
42
                    "income": 34.1,
43
                    "expenses": 29.9,
44
                    "dashLengthColumn": 5,
45
                    "alpha":0.2,
46
                    "additional":"(projection)"
47
                }
48
 
49
            ];
50
 
51
 
52
            AmCharts.ready(function () {
53
                // SERIAL CHART
54
                chart = new AmCharts.AmSerialChart();
55
 
56
                chart.dataProvider = chartData;
57
                chart.categoryField = "year";
58
                chart.startDuration = 1;
59
 
60
                chart.handDrawn = true;
61
                chart.handDrawnScatter = 3;
62
 
63
                // AXES
64
                // category
65
                var categoryAxis = chart.categoryAxis;
66
                categoryAxis.gridPosition = "start";
67
 
68
                // value
69
                var valueAxis = new AmCharts.ValueAxis();
70
                valueAxis.axisAlpha = 0;
71
                chart.addValueAxis(valueAxis);
72
 
73
                // GRAPHS
74
                // column graph
75
                var graph1 = new AmCharts.AmGraph();
76
                graph1.type = "column";
77
                graph1.title = "Income";
78
                graph1.lineColor = "#a668d5";
79
                graph1.valueField = "income";
80
                graph1.lineAlpha = 1;
81
                graph1.fillAlphas = 1;
82
                graph1.dashLengthField = "dashLengthColumn";
83
                graph1.alphaField = "alpha";
84
                graph1.balloonText = "<span style='font-size:13px;'>[[title]] in [[category]]:<b>[[value]]</b> [[additional]]</span>";
85
                chart.addGraph(graph1);
86
 
87
                // line
88
                var graph2 = new AmCharts.AmGraph();
89
                graph2.type = "line";
90
                graph2.title = "Expenses";
91
                graph2.lineColor = "#fcd202";
92
                graph2.valueField = "expenses";
93
                graph2.lineThickness = 3;
94
                graph2.bullet = "round";
95
                graph2.bulletBorderThickness = 3;
96
                graph2.bulletBorderColor = "#fcd202";
97
                graph2.bulletBorderAlpha = 1;
98
                graph2.bulletColor = "#ffffff";
99
                graph2.dashLengthField = "dashLengthLine";
100
                graph2.balloonText = "<span style='font-size:13px;'>[[title]] in [[category]]:<b>[[value]]</b> [[additional]]</span>";
101
                chart.addGraph(graph2);
102
 
103
                // LEGEND
104
                var legend = new AmCharts.AmLegend();
105
                legend.useGraphSettings = true;
106
                chart.addLegend(legend);
107
 
108
                // WRITE
109
                chart.write("chartdiv");
110
            });
111
        </script>
112
    </head>
113
 
114
    <body>
115
        <div id="chartdiv" style="width:50%; height:400px;"></div>
116
    </body>
117
 
118
</html>