詳解FusionChart圖表控件點擊事件


(1)點擊執行js

在頁面中添加點擊chart後需要觸發的js事件:
<script> 
   function myJS(myVar){
      window.alert(myVar);
   }
</script> 
在拼寫加載chart時使用的xml文件時,在<set value="1">中添加link='j-myJS-1,2';

其中,j代表調用的是js,myJS代表你前臺頁面上要調用的js方法名,1代表前臺js方法myJS需要的參數。

在這裏,我點擊chart時需要獲得category 的值:


  for(int j=0;j<commentChartList.size();j++){
   Project project = commentChartList.get(j);
   chartTitle.append("   <category label='"+ project.getShip_no() + "' /> ");
   chartDataSet.append("  <set value='"+project.getProgress_cnt()+"' /> ");
   chartOver.append("  <set value='"+StringUtil.checkNull(project.getClosed_cnt(),"0")+"' link='j-myJS-"+project.getShip_no()+"' /> ");
  }


2)點擊跳轉到新頁面


在拼寫加載chart時使用的xml文件時,在<set value="1">中添加link='test/index.html';


其中,"test/index.htm"爲你需要跳轉的頁面目錄


3)點擊時在原頁面上打開新頁面


在拼寫加載chart時使用的xml文件時,在<set value="1">中添加link='n-test/index.html';


其中,n代表在原頁面上打開新頁面,"test/index.htm"爲你需要跳轉的頁面目錄


4)點擊後在Frame中顯示頁面


頁面中Frame設置如下:


Html代碼:


<frameset rows="350,*" cols="*" frameborder="YES" border="1" framespacing="0">
     <frame src="FramePages/FrameChart.html" name="chartFrame" scrolling="NO" noresize >
     <frame src="FramePages/LowerFrame.html" name="detailsFrame" scrolling="Auto" noresize>
 </frameset>
在拼寫加載chart時使用的xml文件時,在<set value="1">中添加link='F-detailsFrame-test/index.htm';


其中,F代表打開的是Frame,detailsFrame是需要加載的Frame名稱,"test/index.htm"爲你需要跳轉的頁面目錄


5)點擊整個chart作爲熱點


將整個chart作爲一個熱點,點擊chart時打開新頁面:


Xml代碼
<chart caption='Monthly Sales Summary' subcaption='For the year 2006' xAxisName='Month' yAxisName='Sales' numberPrefix='$' clickURL='n-http://www.infosoftglobal.com'>
   <set label='Jan' value='17400' />
   <set label='Feb' value='19800' />
   <set label='Mar' value='21800' />
   <set label='Apr' value='23800' />
   <set label='May' value='29600' />
   <set label='Jun' value='27600' />
</chart>
其中clickURL='n-http://www.infosoftglobal.com'


(6)點擊打開一個popup畫面


在拼寫加載chart時使用的xml文件時,在<set value="1">中添加
link='P-detailsPopUp,width=400,height=300,toolbar=no, scrollbars=no,resizable=no-_template/common/pop_search03.html'


其中P代表打開的是一個pop-up畫面,detailsPopUp爲打開畫面的名稱,“template/common/pop_search03.html”爲要pop的畫面,其他各項爲畫面打開時的參數。
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章