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
                    "country": "USA",
17
                    "visits": 4025,
18
                    "pattern": {"url":"patterns/black/pattern21.png", "width":4, "height":4, "color":"#CC0000"}
19
                },
20
                {
21
                    "country": "China",
22
                    "visits": 1882,
23
                    "pattern": {"url":"patterns/black/pattern20.png", "width":4, "height":4}
24
                },
25
                {
26
                    "country": "Japan",
27
                    "visits": 1809,
28
                    "pattern": {"url":"patterns/black/pattern19.png", "width":4, "height":4}
29
                },
30
                {
31
                    "country": "Germany",
32
                    "visits": 1322,
33
                    "pattern": {"url":"patterns/black/pattern18.png", "width":4, "height":4}
34
                },
35
                {
36
                    "country": "UK",
37
                    "visits": 1122,
38
                    "pattern": {"url":"patterns/black/pattern17.png", "width":4, "height":4}
39
                },
40
                {
41
                    "country": "France",
42
                    "visits": 1114,
43
                    "pattern": {"url":"patterns/black/pattern16.png", "width":4, "height":4}
44
                },
45
                {
46
                    "country": "India",
47
                    "visits": 984,
48
                    "pattern": {"url":"patterns/black/pattern15.png", "width":4, "height":4}
49
                },
50
                {
51
                    "country": "Spain",
52
                    "visits": 711,
53
                    "pattern": {"url":"patterns/black/pattern14.png", "width":4, "height":4}
54
                }
55
            ];
56
 
57
 
58
            AmCharts.ready(function () {
59
                // SERIAL CHART
60
                chart = new AmCharts.AmSerialChart();
61
 
62
                chart.dataProvider = chartData;
63
                chart.categoryField = "country";
64
 
65
                // AXES
66
                // category
67
                var categoryAxis = chart.categoryAxis;
68
                categoryAxis.gridAlpha = 0;
69
                categoryAxis.axisAlpha = 0;
70
                categoryAxis.gridPosition = "start";
71
 
72
                // value
73
                var valueAxis = new AmCharts.ValueAxis();
74
                valueAxis.axisAlpha = 0;
75
                valueAxis.gridAlpha = 0;
76
                chart.addValueAxis(valueAxis);
77
 
78
                // GRAPH
79
                var graph = new AmCharts.AmGraph();
80
                graph.valueField = "visits";
81
                graph.balloonText = "[[category]]: <b>[[value]]</b>";
82
                graph.type = "column";
83
                graph.lineAlpha = 0;
84
                graph.lineColor = "#000000";
85
                graph.fillAlphas = 0.8;
86
                graph.patternField = "pattern";
87
                chart.addGraph(graph);
88
 
89
                // CURSOR
90
                var chartCursor = new AmCharts.ChartCursor();
91
                chartCursor.cursorAlpha = 0;
92
                chartCursor.zoomable = false;
93
                chartCursor.categoryBalloonEnabled = false;
94
                chart.addChartCursor(chartCursor);
95
 
96
                chart.creditsPosition = "top-right";
97
 
98
                chart.write("chartdiv");
99
            });
100
        </script>
101
    </head>
102
 
103
    <body>
104
        <div id="chartdiv" style="width: 100%; height: 400px;"></div>
105
    </body>
106
 
107
</html>