FusionChart µÄjavascript Ó÷¨
FusionChart ¾Í²»ÓýéÉÜÁË°Ñ£¬Ò»¿îÖ§³Ö¶àÖÖÓïÑÔµÄͼ±íÉú³É¿Ø¼þ£¬Éú³ÉµÄͼ±í·á¸»£¬ÃÀ¹Û£¬ÇÒÓж¯Ì¬¸Ð£¬ÒòΪËüÉú´æµÄ¶«Î÷¾ÍÊÇÒ»¸öflash¡£Ò»Ï½éÉÜÒ»ÏÂËüµÄjavascript ʵÏÖ·½Ê½°Ñ¡£
·Ï»°ÉÙ˵£¬Ö±½ÓÉÏʵÀý
<HTML>¡¡¡¡¡¡¡¡¡¡¡¡
¡¡¡¡ <HEAD>¡¡¡¡¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡¡¡ <SCRIPT LANGUAGE="Javascript" SRC="js/FusionCharts.js"></SCRIPT>¡¡¡¡¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡¡¡ <SCRIPT LANGUAGE="JavaScript">¡¡¡¡¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ //Êý¾Ý¡¡¡¡
var strXML = "<graph caption='Hours worked' showNames='1'> <set name='Tom' value='32' color='AFD8F8'/><set name='Mary' value='16' color='F6BD0F'/><set name='Jane' value='42' color='8BBA00'/></graph>";¡¡¡¡¡¡¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ /**//*¡¡¡¡¡¡¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ * µ±Óû§µ¥»÷°´Å¥Ê±µ÷ÓÃÕâ¸ö·½·¨¡£¡¡¡¡¡¡¡¡¡¡¡¡¡¡
¡¡ * Õâ¸ö·½·¨ÓÃÀ´Ê¹ÓÃеÄSWFÎļþ´´½¨Ò»¸öеÄFusionChartsʵÀý¡£¡¡¡¡¡¡¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ */¡¡¡¡¡¡¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ function updateChart(chartSWF){¡¡¡¡¡¡¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ //Create another instance of the chart.¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ var chart1 = new FusionCharts(chartSWF, "chart1Id", "400", "300", "0", "0");¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ chart1.setDataXML(strXML);¡¡¡¡¡¡¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ chart1.render("chart1div");¡¡¡¡¡¡¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ }¡¡¡¡¡¡¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡¡¡ </SCRIPT>¡¡¡¡¡¡¡¡¡¡¡¡
¡¡¡¡ </HEAD>¡¡¡¡¡¡¡¡¡¡¡¡
<BODY>¡¡¡¡¡¡¡¡¡¡¡¡
¡¡¡¡ <div id="chart1div">¡¡¡¡¡¡¡¡¡¡¡¡
¡¡¡¡ FusionCharts¡¡¡¡¡¡¡¡¡¡¡¡¡¡
¡¡¡¡ </div>¡¡¡¡¡¡¡¡¡¡¡¡
¡¡¡¡ <script language="JavaScript">¡¡
¡¡¡¡
¡¡¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡¡¡ var chart1 = new FusionCharts("functionchart/Column3D.swf", "chart1Id", "400", "300", "0", "0");¡¡¡¡¡¡¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡¡¡ chart1.setDataXML(strXML);¡¡¡¡¡¡¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡¡¡ chart1.render("chart1div");¡¡¡¡
¡¡¡¡¡¡¡¡¡¡
¡¡¡¡ </script>¡¡¡¡¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡
¡¡¡¡ <
Ïà¹ØÎĵµ£º
±Õ°ü£¨closure£©ÊÇJavascriptÓïÑÔµÄÒ»¸öÄѵ㣬ҲÊÇËüµÄÌØÉ«£¬ºÜ¶à¸ß¼¶Ó¦Óö¼ÒªÒÀ¿¿±Õ°üʵÏÖ¡£
ÏÂÃæ¾ÍÊÇÎÒµÄѧϰ±Ê¼Ç£¬¶ÔÓÚJavascript³õѧÕßÓ¦¸ÃÊǺÜÓÐÓõġ£
Ò»¡¢±äÁ¿µÄ×÷ÓÃÓò
ÒªÀí½â±Õ°ü£¬Ê×ÏȱØÐëÀí½âJavascriptÌØÊâµÄ±äÁ¿×÷ÓÃÓò¡£
±äÁ¿µÄ×÷ÓÃÓòÎ޷ǾÍÊÇÁ½ÖÖ£ºÈ«¾Ö±äÁ¿ºÍ¾Ö²¿±äÁ¿¡£
JavascriptÓïÑÔµÄÌØÊâÖ®´¦£¬¾ÍÔÚÓ ......
1. ±ê×¼µÄ·½·¨
<mce:script type="text/javascript"><!--
function openWin(src, width, height, showScroll){
window.showModalDialog (src,"","location:No;status:No;help:No;dialogWidth:"+width+";dialogHeight:"+height+";scroll:"+showScroll+";");
}
// --></mce:script> &n ......
1.document.formName.item("itemName") ÎÊÌâ
˵ Ã÷:IEÏÂ,¿ÉÒÔʹÓÃdocument.formName.item("itemName")»òdocument.formName.elements ["elementName"];FirefoxÏÂ,Ö»ÄÜʹÓÃdocument.formName.elements["elementName"].
½â¾ö·½·¨:ͳһʹÓÃdocument.formName.elements["elementName"].
2.¼¯ºÏÀà¶ÔÏóÎÊÌâ
˵Ã÷:IEÏÂ,¿ÉÒÔ ......
ÖÆ×÷ÍøÒ³µÄ¹ý³ÌÖУ¬ÄãÓÐʱºòÐèÒªÖªµÀij¸öÔªËØÔÚÍøÒ³ÉϵÄÈ·ÇÐλÖá£
ÏÂÃæµÄ½Ì³Ì×ܽáÁËJavascriptÔÚÍøÒ³¶¨Î»·½ÃæµÄÏà¹Ø֪ʶ¡£
Ò»¡¢ÍøÒ³µÄ¾ø¶Ô´óСºÍÏà¶Ô´óС
Ê×ÏÈ£¬ÒªÃ÷È·Á½¸ö»ù±¾¸ÅÄî¡£
Ò»ÕÅÍøÒ³µÄÈ«²¿Ãæ»ý£¬¾ÍÊÇËüµÄ¾ø¶Ô´óС¡£Í¨³£Çé¿öÏ£¬ÍøÒ³µÄ¾ø¶Ô´óСÓÉÄÚÈݺÍCSSÑùʽ±í¾ö¶¨¡£
ÍøÒ³µÄÏà¶Ô´óСÔòÊÇÖ¸ÔÚä¯ÀÀÆ÷´°¿ÚÖп ......
1ÅжÏselectÑ¡ÏîÖÐ ÊÇ·ñ´æÔÚValue="paraValue"µÄItem
2ÏòselectÑ¡ÏîÖÐ ¼ÓÈëÒ»¸öItem
3´ÓselectÑ¡ÏîÖРɾ³ýÒ»¸öItem
4ɾ³ýselectÖÐÑ¡ÖеÄÏî
5ÐÞ¸ÄselectÑ¡ÏîÖÐ value="paraValue"µÄtextΪ"paraText"
6ÉèÖÃselectÖÐtext="paraText"µÄµ ......