在coldfusion中,我們可以使用cfchart來製作很漂亮的flash圖表,但有個疑問是,用cfchart動態生成的圖表,可以不可以被存放呢,原本它是放在Cfusion7目錄下的charting中的cache目錄下,做為臨時文件來顯示,但如果我們需要把生成的圖表文件提供給對方下載,應該把它另存起來,把cfchart的內容作為二進制的信息存放給cffile中的output中。


範例代碼是這樣的:



chartformat" default="flash">

chart_width
" default="300">

chart_height" default="200">


"#chartformat#">

 "flash">Fileext = '.swf'>

 "png">Fileext = '.png'>

 "jpg">Fileext = '.jpg'>



filename = RandRange(10000, 99999) & '#fileext#'>



FileExists(#ExpandPath('charts/' & filename)#)>

 action="delete" file="#ExpandPath('images/' & filename)#">



"any">


"flash"

xaxistitle="服務站"

yaxistitle="日結金額"

show3d="no"

backgroundcolor="f1f3f5"

name="aa"

>

line">

 服務站1" value="2000">

 服務站2" value="2800">

 服務站3" value="3050">

 服務站4" value="2500">

 服務站5" value="2700">




ReservationChart" type="exclusive" timeout="10">

 
  action="write"

  charset="utf-8"

  file="#ExpandPath('charts/' & filename)#"

  output="#aa#"

  addnewline="yes">


tempstring = "



       

       
">

returnstring = '#Replace(tempstring, "'", """", "ALL")#'>


#returnstring#



引用自:查爾斯實驗室


arrow
arrow
    全站熱搜

    狼翔月影 發表在 痞客邦 留言(0) 人氣()