. * * @copyright Copyright 2009-2010 青岛易软天创网络科技有限公司(www.cnezsoft.com) * @author Chunsheng Wang * @package report * @version $Id$ * @link http://www.zentaoms.com */ ?> app->getWebRoot() . 'fusioncharts/'; $swfFile = "fcf_$swf.swf"; return << EOT; } /* 创建js输出的chart。*/ public function createJSChart($swf, $dataXML, $width = 'auto', $height = 500) { $jsRoot = $this->app->getWebRoot() . 'js/'; static $count = 0; $count ++; $chartRoot = $this->app->getWebRoot() . 'fusioncharts/'; $swfFile = "fcf_$swf.swf"; $divID = "chart{$count}div"; $chartID = "chart{$count}"; $js = ''; if($count == 1) $js = ""; return << EOT; } /* 生成single系列的xml数据。。 */ public function createSingleXML($sets, $chartOptions = array()) { $data = pack("CCC", 0xef, 0xbb, 0xbf); $data .=""; $data .= ' $value) $data .= " $key='$value'"; $data .= ">"; $colorCount = count($this->lang->report->colors); $i = 0; foreach($sets as $set) { if($i == $colorCount) $i = 0; $color = $this->lang->report->colors[$i]; $i ++; $data .= ""; } $data .= ""; return $data; } /* 输出渲染js图标的语句。*/ public function rendJsCharts($chartCount) { $js = ''; return $js; } /* 计算每条数据所占的百分比。*/ public function computePercent($datas) { $sum = 0; foreach($datas as $data) $sum += $data->value; foreach($datas as $data) $data->percent = round($data->value / $sum, 2); return $datas; } }