?? php-swf charts tutorial chart_source.htm
字號(hào):
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0071)http://www.maani.us/charts/index.php?menu=Tutorial&submenu=Chart_Source -->
<HTML><HEAD><TITLE>PHP/SWF Charts > Tutorial > Chart_Source</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<META
content="chart charts php swf php/swf xml xml/swf tool shockwave flash web graph graphs dynamic data Line column 3D Pie Stacked bar area Candlestick Scatter Mixed Jarir Maani charting plot"
name=Keywords>
<META
content="A simple, yet powerful PHP tool to create attractive web charts from dynamic data."
name=description><LINK
href="PHP-SWF Charts Tutorial Chart_Source.files/style.css" type=text/css
rel=stylesheet><LINK href="favicon.ico" type=image/x-icon rel=icon><LINK
href="favicon.ico" type=image/x-icon rel="shortcut icon">
<SCRIPT src="PHP-SWF Charts Tutorial Chart_Source.files/urchin.js"
type=text/javascript>
</SCRIPT>
<SCRIPT type=text/javascript>
_uacct = "UA-160905-1";
urchinTracker();
</SCRIPT>
<META content="MSHTML 6.00.2800.1595" name=GENERATOR></HEAD>
<BODY bottomMargin=0 leftMargin=0 topMargin=0 rightMargin=0 Marginwidth="0"
Marginheight="0"><!-- table width must be greater than ever needed to avoid menu shrinking -->
<TABLE height=600 cellSpacing=0 cellPadding=10 width="100%" align=left border=0
frame=void>
<TBODY>
<TR>
<TD class=header vAlign=center colSpan=2 height=30><!-- header start ========================================================= --><!-- <a href="/charts/index.php">PHP/SWF Charts</a> --><A
href="http://www.maani.us/charts/index.php"><FONT color=#aabbcc>PHP/SWF
Charts</FONT></A> <FONT color=#ff4400><SMALL>4.5</SMALL></FONT>
<!--<img src="graphics/blank.gif" width=20 height=1><font color=222222>|</font><img src="graphics/blank.gif" width=20 height=1>
<a href="/slideshow/"><font color=666666>PHP/SWF Slideshow</font></a>--><IMG
height=1 src="PHP-SWF Charts Tutorial Chart_Source.files/blank.gif"
width=20><FONT color=#222222>|</FONT><IMG height=1
src="PHP-SWF Charts Tutorial Chart_Source.files/blank.gif" width=20> <A
href="http://www.maani.us/xml_charts/"><FONT color=#666666>XML/SWF
Charts</FONT></A> <IMG height=1
src="PHP-SWF Charts Tutorial Chart_Source.files/blank.gif"
width=20><FONT color=#222222>|</FONT><IMG height=1
src="PHP-SWF Charts Tutorial Chart_Source.files/blank.gif" width=20> <A
href="http://www.maani.us/xml_slideshow/"><FONT color=#666666>XML/SWF
Slideshow</FONT></A> <IMG height=1
src="PHP-SWF Charts Tutorial Chart_Source.files/blank.gif"
width=20><FONT color=#222222>|</FONT><IMG height=1
src="PHP-SWF Charts Tutorial Chart_Source.files/blank.gif" width=20> <A
href="http://www.maani.us/gauge/"><FONT color=#666666>XML/SWF
Gauge</FONT></A> <!-- header end --></TD></TR>
<TR>
<TD class=menu width=150><!-- menu start ========================================================= --><!-- SiteSearch Google -->
<FORM action=http://www.google.com/search method=get><INPUT type=hidden
value=UTF-8 name=ie> <INPUT type=hidden value=UTF-8 name=oe> <INPUT
class=form maxLength=255 size=10 name=q> <INPUT class=form type=submit value=Search name=btnG> <INPUT type=hidden
value=www.maani.us/charts/ name=domains> <INPUT type=hidden
value=www.maani.us/charts/ name=sitesearch> </FORM>
<HR color=#888888 noShade SIZE=1>
<B><A
href="http://www.maani.us/charts/index.php?menu=Introduction">Introduction</A></B><BR><B><A
href="http://www.maani.us/charts/index.php?menu=Gallery">Gallery</A></B><BR><B><A
href="http://www.maani.us/charts/index.php?menu=Requirements">Requirements</A></B><BR><B><A
href="http://www.maani.us/charts/index.php?menu=Download">Download</A></B><BR><B><A
href="http://www.maani.us/charts/index.php?menu=Installation">Installation</A></B><BR><B><FONT
color=#dddddd>Tutorial</FONT></B><BR><SMALL> </SMALL><BR><SMALL> <A
href="http://www.maani.us/charts/index.php?menu=Tutorial&submenu=Basics">Basics</A></SMALL><BR><SMALL> <A
href="http://www.maani.us/charts/index.php?menu=Tutorial&submenu=Chart_Data">Chart
Data</A></SMALL><BR><SMALL> <A
href="http://www.maani.us/charts/index.php?menu=Tutorial&submenu=Chart_Attributes">Chart
Attributes</A></SMALL><BR><SMALL><B> Chart
Source</B></SMALL><BR><SMALL> </SMALL><BR><B><A
href="http://www.maani.us/charts/index.php?menu=Reference">Reference</A></B><BR><B><A
href="http://www.maani.us/charts/index.php?menu=FAQ">FAQ</A></B><BR>
<HR color=#888888 noShade SIZE=1>
<B><A
href="http://www.maani.us/charts/index.php?menu=License">License</A></B><BR><B><A
href="http://www.maani.us/charts/index.php?menu=Contact_Us">Contact
Us</A></B><BR><IMG height=150
src="PHP-SWF Charts Tutorial Chart_Source.files/blank.gif"> <!-- menu end --></TD>
<TD class=body><!-- body start ========================================================= -->
<TABLE cellSpacing=0 cellPadding=5 width="100%" align=left border=0>
<TBODY>
<TR>
<TD width=40><IMG
src="PHP-SWF Charts Tutorial Chart_Source.files/blank.gif"
width=20></TD><!-- left margin -->
<TD vAlign=top>
<P></P>
<TABLE cellSpacing=0 cellPadding=2 width="100%" border=0>
<TBODY>
<TR class=prev_next>
<TD align=left> <A
href="http://www.maani.us/charts/index.php?menu=Tutorial&submenu=Chart_Attributes"><B><
previous</B></A></TD>
<TD align=right> </TD></TR></TBODY></TABLE>
<P></P>
<P> </P>
<P><IMG height=0
src="PHP-SWF Charts Tutorial Chart_Source.files/blank.gif"></P><!-- top margin -->
<P><B><BIG>Chart Source</BIG></B></P>
<P> </P>
<P><B>Passing variables to Chart Source</B></P>
<P>Pass variables to the chart's source in the query part of the
source's URL like this:</P><!-- PHP -------------------------------------->
<P></P>
<TABLE cellPadding=10 border=0>
<TBODY>
<TR>
<TD class=php><FONT size=3><PRE><HTML>
<BODY bgcolor="#FFFFFF">
<?php
include "charts.php";
echo InsertChart ( "charts.swf", "charts_library", "sample.php?chart_type=bar&user_id=658" );
?>
</BODY>
</HTML>
</PRE></FONT></TD></TR></TBODY></TABLE>
<P></P><!-- PHP -------------------------------------->
<P> </P>
<P>The <B>sample.php</B> source might read the variables and
generate the chart's data like this:</P><!-- PHP -------------------------------------->
<P></P>
<TABLE cellPadding=10 border=0>
<TBODY>
<TR>
<TD class=php><FONT size=3><PRE>
<?php
<FONT color=#888888>//include charts.php in your script</FONT>
include "charts.php";
<FONT color=#888888>//read the query variables</FONT>
$type = $_REQUEST['chart_type'];
$id = $_REQUEST['user_id'];
if ( $id==658 ){
<FONT color=#888888>//make the chart type the same as the $type variable for user #658</FONT>
$chart [ 'chart_type' ] = $type;
}else{
<FONT color=#888888>//make it a line chart for all other users</FONT>
$chart [ 'chart_type' ] = "line";
}
<FONT color=#888888>//send the chart data to the charts.swf flash file</FONT>
SendChartData ( $chart );
?>
</PRE></FONT></TD></TR></TBODY></TABLE>
<P></P><!-- PHP -------------------------------------->
<P> </P>
<HR color=#888888 noShade SIZE=1>
<P><B>Debugging</B></P>
<P>To debug the source code, type the URL of the source file
directly in a browser. If the source script contains errors, then
the browser should display them. If it does not contain errors, then
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -