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
	<head>
4
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
5
		<title>amStock Example</title>
6
		<link rel="stylesheet" href="../amcharts/style.css"	type="text/css">
7
 
8
		<script src="../amcharts/amcharts.js" type="text/javascript"></script>
9
		<script src="../amcharts/serial.js" type="text/javascript"></script>
10
		<script src="../amcharts/amstock.js" type="text/javascript"></script>
11
 
12
		<script>
13
			var chartData = generateChartData();
14
 
15
			function generateChartData() {
16
			  var chartData = [];
17
			  var firstDate = new Date( 2012, 0, 1 );
18
			  firstDate.setDate( firstDate.getDate() - 500 );
19
			  firstDate.setHours( 0, 0, 0, 0 );
20
 
21
			  for ( var i = 0; i < 500; i++ ) {
22
			    var newDate = new Date( firstDate );
23
			    newDate.setDate( newDate.getDate() + i );
24
 
25
			    var value = Math.round( Math.random() * ( 40 + i ) ) + 100 + i;
26
 
27
			    chartData.push( {
28
			      date: newDate,
29
			      value: value
30
			    } );
31
			  }
32
			  return chartData;
33
			}
34
 
35
 
36
			var chart = AmCharts.makeChart( "chartdiv", {
37
 
38
			  type: "stock",
39
			  "theme": "light",
40
 
41
			  dataSets: [ {
42
			    color: "#b0de09",
43
			    fieldMappings: [ {
44
			      fromField: "value",
45
			      toField: "value"
46
			    } ],
47
			    dataProvider: chartData,
48
			    categoryField: "date"
49
			  } ],
50
 
51
			  panels: [ {
52
			    showCategoryAxis: true,
53
			    title: "Value",
54
			    eraseAll: false,
55
			    allLabels: [ {
56
			      x: 0,
57
			      y: 115,
58
			      text: "Click on the pencil icon on top-right to start drawing",
59
			      align: "center",
60
			      size: 16
61
			    } ],
62
 
63
			    stockGraphs: [ {
64
			      id: "g1",
65
			      valueField: "value",
66
			      useDataSetColors: false
67
			    } ],
68
 
69
 
70
			    stockLegend: {
71
			      valueTextRegular: " ",
72
			      markerType: "none"
73
			    },
74
 
75
			    drawingIconsEnabled: true
76
			  } ],
77
 
78
			  chartScrollbarSettings: {
79
			    graph: "g1"
80
			  },
81
			  chartCursorSettings: {
82
			    valueBalloonsEnabled: true
83
			  },
84
			  periodSelector: {
85
			    position: "bottom",
86
			    periods: [ {
87
			      period: "DD",
88
			      count: 10,
89
			      label: "10 days"
90
			    }, {
91
			      period: "MM",
92
			      count: 1,
93
			      label: "1 month"
94
			    }, {
95
			      period: "YYYY",
96
			      count: 1,
97
			      label: "1 year"
98
			    }, {
99
			      period: "YTD",
100
			      label: "YTD"
101
			    }, {
102
			      period: "MAX",
103
			      label: "MAX"
104
			    } ]
105
			  }
106
			} );
107
 
108
 
109
 
110
		</script>
111
	</head>
112
	<body style="background-color:#FFFFFF">
113
		<div id="chartdiv" style="width:100%; height:600px;"></div>
114
	</body>
115
 
116
</html>