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
            // since v3, chart can accept data in JSON format
13
            // if your category axis parses dates, you should only
14
            // set date format of your data (dataDateFormat property of AmSerialChart)
15
            var lineChartData = [
16
                {
17
                    "date": "2009-10-02",
18
                    "value": 5
19
                },
20
                {
21
                    "date": "2009-10-03",
22
                    "value": 15
23
                },
24
                {
25
                    "date": "2009-10-04",
26
                    "value": 13
27
                },
28
                {
29
                    "date": "2009-10-05",
30
                    "value": 17
31
                },
32
                {
33
                    "date": "2009-10-06",
34
                    "value": 15
35
                },
36
                {
37
                    "date": "2009-10-09",
38
                    "value": 19
39
                },
40
                {
41
                    "date": "2009-10-10",
42
                    "value": 21
43
                },
44
                {
45
                    "date": "2009-10-11",
46
                    "value": 20
47
                },
48
                {
49
                    "date": "2009-10-12",
50
                    "value": 20
51
                },
52
                {
53
                    "date": "2009-10-13",
54
                    "value": 19
55
                },
56
                {
57
                    "date": "2009-10-16",
58
                    "value": 25
59
                },
60
                {
61
                    "date": "2009-10-17",
62
                    "value": 24
63
                },
64
                {
65
                    "date": "2009-10-18",
66
                    "value": 26
67
                },
68
                {
69
                    "date": "2009-10-19",
70
                    "value": 27
71
                },
72
                {
73
                    "date": "2009-10-20",
74
                    "value": 25
75
                },
76
                {
77
                    "date": "2009-10-23",
78
                    "value": 29
79
                },
80
                {
81
                    "date": "2009-10-24",
82
                    "value": 28
83
                },
84
                {
85
                    "date": "2009-10-25",
86
                    "value": 30
87
                },
88
                {
89
                    "date": "2009-10-26",
90
                    "value": 72,
91
                    "customBullet": "images/redstar.png"
92
                },
93
                {
94
                    "date": "2009-10-27",
95
                    "value": 43
96
                },
97
                {
98
                    "date": "2009-10-30",
99
                    "value": 31
100
                },
101
                {
102
                    "date": "2009-11-01",
103
                    "value": 30
104
                },
105
                {
106
                    "date": "2009-11-02",
107
                    "value": 29
108
                },
109
                {
110
                    "date": "2009-11-03",
111
                    "value": 27
112
                },
113
                {
114
                    "date": "2009-11-04",
115
                    "value": 26
116
                }
117
            ];
118
 
119
            AmCharts.ready(function () {
120
                var chart = new AmCharts.AmSerialChart();
121
                chart.dataProvider = lineChartData;
122
 
123
                chart.categoryField = "date";
124
                chart.dataDateFormat = "YYYY-MM-DD";
125
 
126
                // sometimes we need to set margins manually
127
                // autoMargins should be set to false in order chart to use custom margin values
128
                chart.autoMargins = false;
129
                chart.marginRight = 0;
130
                chart.marginLeft = 0;
131
                chart.marginBottom = 0;
132
                chart.marginTop = 0;
133
 
134
                // AXES
135
                // category
136
                var categoryAxis = chart.categoryAxis;
137
                categoryAxis.parseDates = true; // as our data is date-based, we set parseDates to true
138
                categoryAxis.minPeriod = "DD"; // our data is daily, so we set minPeriod to DD
139
                categoryAxis.inside = true;
140
                categoryAxis.gridAlpha = 0;
141
                categoryAxis.tickLength = 0;
142
                categoryAxis.axisAlpha = 0;
143
 
144
                // value
145
                var valueAxis = new AmCharts.ValueAxis();
146
                valueAxis.dashLength = 4;
147
                valueAxis.axisAlpha = 0;
148
                chart.addValueAxis(valueAxis);
149
 
150
                // GRAPH
151
                var graph = new AmCharts.AmGraph();
152
                graph.type = "line";
153
                graph.valueField = "value";
154
                graph.lineColor = "#D8E63C";
155
                graph.customBullet = "images/star.png"; // bullet for all data points
156
                graph.bulletSize = 14; // bullet image should be a rectangle (width = height)
157
                graph.customBulletField = "customBullet"; // this will make the graph to display custom bullet (red star)
158
                chart.addGraph(graph);
159
 
160
                // CURSOR
161
                var chartCursor = new AmCharts.ChartCursor();
162
                chart.addChartCursor(chartCursor);
163
 
164
                // WRITE
165
                chart.write("chartdiv");
166
            });
167
        </script>
168
    </head>
169
 
170
    <body>
171
        <div id="chartdiv" style="width:100%; height:400px;"></div>
172
    </body>
173
 
174
</html>