欢迎来到Doc100.Net免费学习资源知识分享平台!
您的位置:首页 > 程序异常 >

fusionchart没有数据时报表显示有关问题

更新时间: 2014-01-05 03:06:53 责任编辑: Author_N1

 

fusionchart没有数据时报表显示问题

1.设置ChartNoDataToDiaplay

 

new FusionChart("Pie3D.swf?ChartNoDataToDiaplay=没有数据信息","chartId","600","250","1");

注意,第五个参数一定要设置为1

 

2.这样的提示视乎还不够友好,那么还可以用js函数,进行需要的操作

 

function FC_NoDataToDiaplay(DOMId){

 

}

 

其中DOMId是够着图标时候设定的ID。

 

参考:其实,fusionchart还有一些可以自动触发的函数,合理应用可以使自己的设计更友好更人性化。例如:

Event Name When is it raised? What to use it for?
FC_Loaded(DOMId) When the chart SWF has finished downloading in the user's browser. To hide any loader components that you might have on your page.
FC_Rendered(DOMId) When the chart has finished rendering. This call is made only once per loaded chart SWF (even if new data is supplied to it via setDataURL or setDataXML method). To invoke any further JavaScript methods on chart, or to change the data of chart.
FC_DataLoaded(DOMId) When the data of the chart has finished loading - both in dataXML or dataURL method. To further process data in any other components in your page.
FC_DataLoadError(DOMId) When there was an error in loading data from the specified URL To show an error message to user, or to take a corrective measure
FC_NoDataToDisplay(DOMId) When the XML data loaded by chart didn't contain any data to display To show an error message to user, or to take a corrective measure
FC_DataXMLInvalid(DOMId) When the XML data loaded by chart was invalid (wrong XML structure) To show an error message to user, or to take a corrective measure

How to track these events?
The events raised by FusionCharts are simple JavaScript functions that are invoked, and the DOMId of the invoking chart is passed to the function to help you identify the source. For example, the FC_Rendered event for a chart can be tracked using following code:
<HTML>
<HEAD>
   <TITLE>FusionCharts & JavaScript - Basic Example</TITLE>
   <SCRIPT LANGUAGE="Javascript" SRC="../../FusionCharts/FusionCharts.js"></SCRIPT>
   <SCRIPT LANGUAGE="JavaScript">
      //FC_Rendered method is called whenever a FusionCharts chart on the page
      //has finished initial rendering. To this function, the chart passes its
      //own DOM Id.

      function FC_Rendered(DOMId){
         //If it's our required chart
         if (DOMId=="chart1Id"){
            //Simply alert
            window.alert("Look Ma! I am Column3D and I've finished loading and rendering.");
            return;
         }
      }
   </SCRIPT>
</HEAD>
<BODY>
   <div id="chart1div">
      FusionCharts
   </div>
   <script language="JavaScript">
      var chart1 = new FusionCharts("../../FusionCharts/Column3D.swf", "chart1Id", "400", "300", "0", "1");
      chart1.setDataXML("<chart><set label='A' value='10' /><set label='B' value='11' /></chart>");
      chart1.render("chart1div");
   </script>
</BODY>
</HTML>
上一篇:上一篇
下一篇:下一篇

 

随机推荐程序问答结果

 

 

如对文章有任何疑问请提交到问题反馈,或者您对内容不满意,请您反馈给我们DOC100.NET论坛发贴求解。
DOC100.NET资源网,机器学习分类整理更新日期::2014-01-05 03:06:53
如需转载,请注明文章出处和来源网址:http://www.doc100.net/bugs/t/18438/
本文WWW.DOC100.NET DOC100.NET版权所有。