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
            // note, each data item has "bullet" field.
13
            var columnChartData = [
14
                {
15
                    "name": "John",
16
                    "points": 35654,
17
                    "color": "#7F8DA9",
18
                    "bullet": "images/0.gif"
19
                },
20
                {
21
                    "name": "Damon",
22
                    "points": 65456,
23
                    "color": "#FEC514",
24
                    "bullet": "images/1.gif"
25
                },
26
                {
27
                    "name": "Patrick",
28
                    "points": 45724,
29
                    "color": "#DB4C3C",
30
                    "bullet": "images/2.gif"
31
                },
32
                {
33
                    "name": "Mark",
34
                    "points": 13654,
35
                    "color": "#DAF0FD",
36
                    "bullet": "images/3.gif"
37
                }
38
            ];
39
 
40
 
41
            AmCharts.ready(function () {
42
                // SERIAL CHART
43
                var chart = new AmCharts.AmSerialChart();
44
                chart.dataProvider = columnChartData;
45
                chart.categoryField = "name";
46
                chart.startDuration = 1;
47
                // sometimes we need to set margins manually
48
                // autoMargins should be set to false in order chart to use custom margin values
49
                chart.autoMargins = false;
50
                chart.marginRight = 0;
51
                chart.marginLeft = 0;
52
                chart.marginBottom = 0;
53
                chart.marginTop = 0;
54
 
55
                // AXES
56
                // category
57
                var categoryAxis = chart.categoryAxis;
58
                categoryAxis.inside = true;
59
                categoryAxis.axisAlpha = 0;
60
                categoryAxis.gridAlpha = 0;
61
                categoryAxis.tickLength = 0;
62
 
63
                // value
64
                var valueAxis = new AmCharts.ValueAxis();
65
                valueAxis.minimum = 0;
66
                valueAxis.axisAlpha = 0;
67
                valueAxis.maximum = 80000;
68
                valueAxis.dashLength = 4;
69
                chart.addValueAxis(valueAxis);
70
 
71
                // GRAPH
72
                var graph = new AmCharts.AmGraph();
73
                graph.valueField = "points";
74
                graph.customBulletField = "bullet"; // field of the bullet in data provider
75
                graph.bulletOffset = 16; // distance from the top of the column to the bullet
76
                graph.colorField = "color";
77
                graph.bulletSize = 34; // bullet image should be rectangle (width = height)
78
                graph.type = "column";
79
                graph.fillAlphas = 0.8;
80
                graph.cornerRadiusTop = 8;
81
                graph.lineAlpha = 0;
82
                graph.balloonText = "<span style='font-size:13px;'>[[category]]: <b>[[value]]</b></span>";
83
                chart.addGraph(graph);
84
 
85
                // WRITE
86
                chart.write("chartdiv");
87
            });
88
        </script>
89
    </head>
90
 
91
    <body>
92
        <div id="chartdiv" style="width: 520px; height: 400px;"></div>
93
    </body>
94
 
95
</html>