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 URLTo 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 displayTo 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>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值