Open Flash Chart 使用
發表於 : 2008-10-15 21:55:09
http://teethgrinder.co.uk/open-flash-ch ... torial.php
1.拷貝 open-flash-chart.swf 及 js 目錄 及 php-ofc-library 至 apache 的根目錄
2.將 php-ofc-library 改名為 ofc-library
3.chart.php
<html>
<head>
<script></script>
<script>
swfobject.embedSWF("open-flash-chart.swf", "my_chart", "600", "400", "9.0.0");
</script>
</head>
<body>
<p>Hello World</p>
<div></div>
</body>
</html>
4.data.json
{
"title":{
"text": "大豐駕訓班",
"style": "{font-size: 20px; color:#0000ff; font-family: Verdana; text-align: center;}"
},
"y_legend":{
"text": "Open Flash Chart",
"style": "{color: #736AFF; font-size: 12px;}"
},
"elements":[
{
"type": "bar",
"alpha": 0.5,
"colour": "#9933CC",
"text": "Page views",
"font-size": 10,
"values" : [9,6,7,9,5,7,6,9,7]
},
{
"type": "bar",
"alpha": 0.5,
"colour": "#CC9933",
"text": "Page views 2",
"font-size": 10,
"values" : [6,7,9,5,7,6,9,7,3]
}
],
"x_axis":{
"stroke":1,
"tick_height":10,
"colour":"#d000d0",
"grid_colour":"#00ff00",
"labels": ["January","February","March","April","May","June","July","August","Spetember"]
},
"y_axis":{
"stroke": 4,
"tick_length": 3,
"colour": "#d000d0",
"grid_colour": "#00ff00",
"offset": 0,
"max": 20
}
}
5.看圖囉
http://127.0.0.1/chart.php??ofc=data.json
1.拷貝 open-flash-chart.swf 及 js 目錄 及 php-ofc-library 至 apache 的根目錄
2.將 php-ofc-library 改名為 ofc-library
3.chart.php
<html>
<head>
<script></script>
<script>
swfobject.embedSWF("open-flash-chart.swf", "my_chart", "600", "400", "9.0.0");
</script>
</head>
<body>
<p>Hello World</p>
<div></div>
</body>
</html>
4.data.json
{
"title":{
"text": "大豐駕訓班",
"style": "{font-size: 20px; color:#0000ff; font-family: Verdana; text-align: center;}"
},
"y_legend":{
"text": "Open Flash Chart",
"style": "{color: #736AFF; font-size: 12px;}"
},
"elements":[
{
"type": "bar",
"alpha": 0.5,
"colour": "#9933CC",
"text": "Page views",
"font-size": 10,
"values" : [9,6,7,9,5,7,6,9,7]
},
{
"type": "bar",
"alpha": 0.5,
"colour": "#CC9933",
"text": "Page views 2",
"font-size": 10,
"values" : [6,7,9,5,7,6,9,7,3]
}
],
"x_axis":{
"stroke":1,
"tick_height":10,
"colour":"#d000d0",
"grid_colour":"#00ff00",
"labels": ["January","February","March","April","May","June","July","August","Spetember"]
},
"y_axis":{
"stroke": 4,
"tick_length": 3,
"colour": "#d000d0",
"grid_colour": "#00ff00",
"offset": 0,
"max": 20
}
}
5.看圖囉
http://127.0.0.1/chart.php??ofc=data.json