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": 2005,
16
                    "value": 11.5,
17
                    "error": 5
18
                },
19
                {
20
                    "year": 2006,
21
                    "value": 26.2,
22
                    "error": 5
23
                },
24
                {
25
                    "year": 2007,
26
                    "value": 30.1,
27
                    "error": 5
28
                },
29
                {
30
                    "year": 2008,
31
                    "value": 29.5,
32
                    "error": 7
33
                },
34
                {
35
                    "year": 2009,
36
                    "value": 24.6,
37
                    "error": 10
38
                }
39
            ];
40
 
41
 
42
            AmCharts.ready(function () {
43
                // SERIAL CHART
44
                chart = new AmCharts.AmSerialChart();
45
 
46
                chart.dataProvider = chartData;
47
                chart.categoryField = "year";
48
                chart.startDuration = 1;
49
                chart.balloon.textAlign = "left";
50
 
51
                // AXES
52
                // category
53
                var categoryAxis = chart.categoryAxis;
54
                categoryAxis.gridPosition = "start";
55
                categoryAxis.dashLength = 3;
56
                categoryAxis.axisAlpha = 0;
57
 
58
                // value
59
                var valueAxis = new AmCharts.ValueAxis();
60
                valueAxis.axisAlpha = 0;
61
                valueAxis.dashLength = 3;
62
                chart.addValueAxis(valueAxis);
63
 
64
                // GRAPHS
65
                var graph1 = new AmCharts.AmGraph();
66
                graph1.valueField = "value";
67
                graph1.lineColor = "#ff339d";
68
                graph1.lineThickness = 2;
69
                graph1.bullet = "yError";
70
                graph1.errorField = "error";
71
                graph1.bulletSize = 10; // when bulletAxis is set, this property affects only width of error bar
72
                graph1.bulletAxis = valueAxis;
73
                graph1.balloonText = "value:<b>[[value]]</b><br>error:<b>[[error]]</b>";
74
                chart.addGraph(graph1);
75
 
76
                // one more graph added for circle bullets, as onew graph can show one bullet type only
77
                var graph2 = new AmCharts.AmGraph();
78
                graph2.valueField = "value";
79
                graph2.lineColor = "#ff339d";
80
                graph2.lineThickness = 2;
81
                graph2.lineAlpha = 0;
82
                graph2.bullet = "round";
83
                graph2.bulletBorderThickness = 2;
84
                graph2.bulletBorderColor = "#FFFFFF";
85
                graph2.bulletBorderAlpha = 1;
86
                graph2.showBalloon = false;
87
                chart.addGraph(graph2);
88
 
89
                // CURSOR
90
                var chartCursor = new AmCharts.ChartCursor();
91
                chartCursor.cursorAlpha = 0;
92
                chartCursor.zoomable = false;
93
                chartCursor.cursorPosition = "mouse";
94
                chartCursor.graphBulletSize = 1;
95
                chart.addChartCursor(chartCursor);
96
 
97
                // WRITE
98
                chart.write("chartdiv");
99
            });
100
        </script>
101
    </head>
102
 
103
    <body>
104
        <div id="chartdiv" style="width:700px; height:400px;"></div>
105
    </body>
106
 
107
</html>