本文整理汇总了PHP中FusionCharts::setChartParams方法的典型用法代码示例。如果您正苦于以下问题:PHP FusionCharts::setChartParams方法的具体用法?PHP FusionCharts::setChartParams怎么用?PHP FusionCharts::setChartParams使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FusionCharts
的用法示例。
在下文中一共展示了FusionCharts::setChartParams方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: mychart
function mychart()
{
//$this->load->libraries('fusion_pi');
$arrData = array();
$FC = new FusionCharts("Column3D", "720", "400");
/*$arrData = array( 500, 269, 254, 895, 633);
foreach( $arrData as $i=>$data ){
$FC->addChartData( $data );
} */
//$sql="select count(distinct(nama_spb)) as nama_spb,month(tgl_spb) as bln from spb group by concat(month(tgl_spb),year(tgl_spb))";
//echo $sql;
$FC->setDataURL("graph.xml");
$strParam = "numberSuffix=; formatNumberScale=0; decimalPrecision=0; xAxisName=Bulan; animation=1";
$FC->setChartParams($strParam);
$FC->setChartMessage("ChartNoDataText=Chart Data not provided; PBarLoadingText=Please Wait.The chart is loading...");
return $FC->renderChart(false, false);
}
示例2: makeBar
function makeBar($val, $IDSuffix)
{
//---------- Creating First Chart ----------------------------------------------
# Create FusionCharts PHP object
$FC = new FusionCharts("Column3D", "300", "250", "myChartId" . $IDSuffix);
# set the relative path of the swf file
$FC->setSWFPath("../../FusionCharts/");
# Define chart attributes# Set chart attributes
$strParam = "caption=Weekly Sales;subcaption={$val};xAxisName=Week;yAxisName=Revenue;numberPrefix=\$";
# Setting chart attributes
$FC->setChartParams($strParam);
# add chart values and category names for the First Chart
$FC->addChartData("40800", "Label=Week 1");
$FC->addChartData("31400", "Label=Week 2");
$FC->addChartData("26700", "Label=Week 3");
$FC->addChartData("54400", "Label=Week 4");
//-------------------------------------------------------------------
$FC->renderChart();
}
示例3: getFusionChartFromDataArr
private function getFusionChartFromDataArr($arr)
{
$FC = new FusionCharts("Column2D", "500", "350", null, true);
$FC->setSWFPath("/fusionCharts_swf/");
$strParam = "xAxisName=Rating;yAxisName=Number;decimalPrecision=0;formatNumberScale=1";
$FC->setChartParams($strParam);
if (isset($arr["NA"])) {
$FC->addChartData($arr["NA"], "name=N/R");
}
$item = $arr["typeObj"];
if ($item->getId() == EnumItemPeer::RATING_BOOLEAN) {
for ($i = 0; $i < 2; $i++) {
$FC->addChartData($arr[$i], "name={$i}");
}
} elseif ($item->getParentId() == EnumItemPeer::RATING_SCALE) {
for ($i = 0; $i < $item->getDescr(); $i++) {
$FC->addChartData($arr[$i], "name={$i}");
}
} else {
// FIXME type not supported
throw new Exception("type not supported");
}
return $FC;
}
示例4: FusionCharts
<?php
# Include FusionCharts PHP Class
include "../Class/FusionCharts_Gen.php";
# Create Column2D chart Object
$FC = new FusionCharts("column2D", "300", "250");
# set the relative path of the swf file
$FC->setSWFPath("../FusionCharts/");
# Define chart attributes
$strParam = "caption=Weekly Sales;xAxisName=Week;yAxisName=Revenue;numberPrefix=\$";
# Set chart attributes
$FC->setChartParams($strParam);
# add chart values and category names
$FC->addChartData("40800", "label=Week 1");
$FC->addChartData("31400", "label=Week 2");
$FC->addChartData("26700", "label=Week 3");
$FC->addChartData("54400", "label=Week 4");
# Add First TrendLine
$FC->addTrendLine("startValue=42000;color=ff0000");
# Add Second TrendLine
$FC->addTrendLine("startValue=30000;color=008800;displayvalue=Average;showOnTop=1");
# Add TrendZone
$FC->addTrendLine("startValue=50000;endValue=60000;color=0000ff;alpha=20;displayvalue=Dream Sales;showOnTop=1;isTrendZone=1");
?>
<html>
<head>
<title>First Chart - Advanced - Add Trendlines : Using FusionCharts PHP Class</title>
<script language='javascript' src='../FusionCharts/FusionCharts.js'></script>
</head>
<body>
示例5: FusionCharts
<CENTER>
<h2>FusionCharts Examples</h2>
<h4>Example using XML having multilingual text</h4>
<?php
//This page demonstrates the ease of generating charts containing UTF-8 encoded
//multilingual text using FusionCharts PHPClass.
//For this chart, we've cread a chart object used FusionCharts PHP Class
//supply chart data and configurations to it and render chart using the instance
//Here, we've kept this example very simple.
# Create column 2d chart object
$FC = new FusionCharts("Column2D", "500", "400");
# Set Relative Path of swf file.
$FC->setSWFPath("../../FusionCharts/");
# Set Chart attributes
$FC->setChartParams("caption=Monthly Sales Summary;subcaption=For the year 2008;");
$FC->setChartParams("xAxisName=Month;yAxisName=Sales;numberPrefix=\$;showNames=1;");
$FC->setChartParams("showValues=0;showColumnShadow=1;animation=1;");
$FC->setChartParams("baseFontColor=666666;lineColor=FF5904;lineAlpha=85;");
$FC->setChartParams("valuePadding=10;labelDisplay=rotate;useRoundEdges=1");
#add chart data values and category names
$FC->addChartData("17400", "Label=januári");
$FC->addChartData("19800", "Label=Fevruários");
$FC->addChartData("21800", "Label=مارس");
$FC->addChartData("23800", "Label=أبريل");
$FC->addChartData("29600", "Label=五月");
$FC->addChartData("27600", "Label=六月");
$FC->addChartData("31800", "Label=תִּשׁרִי");
$FC->addChartData("39700", "Label=Marešwān");
$FC->addChartData("37800", "Label=settèmbre");
$FC->addChartData("21900", "Label=ottàgono");
示例6: sendStatusAction
public function sendStatusAction()
{
$oPermission = new Config_Permission();
$oApp = new Config_App();
$oServer = new Config_Server();
$oPartnerApp = new Config_Partner_App();
$oPartner = new Config_Partner();
$oArea = new Config_Area();
//获取用户可以查看的游戏列表
$permitted_app = $oPermission->getApp($this->manager->data_groups, 'AppId,name');
//预处理地区信息
$AreaList = $oArea->getAll();
//检查当前页面权限
$sign = '?ctl=config/socket.queue&ac=send.status';
$this->manager->checkMenuPermission($sign, Widget_Manager::MENU_PURVIEW_SELECT);
$SocketType = $this->oSocketType->getAll();
//页面输入变量
$AppId = intval($this->request->AppId);
$PartnerId = intval($this->request->PartnerId);
$ServerId = intval($this->request->ServerId);
$AreaId = intval($this->request->AreaId) ? intval($this->request->AreaId) : 0;
$app_type = intval($this->request->app_type);
$partner_type = intval($this->request->partner_type);
$is_abroad = intval($this->request->is_abroad) ? intval($this->request->is_abroad) : 0;
$uType = intval($this->request->uType) ? intval($this->request->uType) : 0;
//时间范围初始化
$Date = $this->request->Date ? $this->request->Date : date("Y-m-d", time());
//初始化图表配置
$divideV = 23;
$Step = 60;
//初始化合作商列表
$permitted_partner = array();
//初始化服务器列表
$permitted_server = array();
//获取当前地区列表
$AreaList = $oArea->getAbroad($is_abroad, $AreaList);
//生成允许的地区id数组
if ($app_type > 0) {
//筛选是否平台产品
$permitted_app = $oApp->getApp($app_type, $permitted_app);
}
if ($AppId > 0) {
//获取可查看的权限总表
$permitted_partner = $oPermission->getPartner($this->manager->data_groups, $AppId, 'PartnerId,name,AreaId');
//根据合作方式筛选
$permitted_partner = $oPartnerApp->getPermittedPartnerByPartnerType($partner_type, $permitted_partner);
//根据所在地区筛选
$permitted_partner = $oPartnerApp->getPermittedPartnerByPartnerArea($AreaList, $permitted_partner);
if ($PartnerId > 0) {
//获取服务器列表
$permitted_server = $oPermission->getServer($this->manager->data_groups, $AppId, $PartnerId, 'ServerId,name');
}
}
//获取用于查询的权限sql语句
$SendStatusArr = $this->oSocketQueue->getSendStatus($Date, $ServerId, $uType);
for ($i = 0; $i < 24 * 60; $i++) {
$H = intval($i / 60);
$m = $i - $H * 60;
if (!isset($SendStatusArr[$i])) {
$SendStatusArr[$i] = array('Time' => sprintf("%02d", $H) . ":" . sprintf("%02d", $m), 'SendCount' => 0);
} else {
$SendStatusArr[$i]['Time'] = sprintf('%02d', $H) . ":" . sprintf('%02d', $m);
}
}
ksort($SendStatusArr);
# Include FusionCharts PHP Class
include 'Third/fusion/Includes/FusionCharts_Gen.php';
# Create Multiseries ColumnD chart object using FusionCharts PHP Class
$FC = new FusionCharts("MsLine", '100%', '500');
# Set the relative path of the swf file
$FC->setSWFPath("../Charts/");
# Store chart attributes in a variable
$strParam = "caption='Socket队列发送情况';animation=0;xAxisName='时间';baseFontSize=12;numberPrefix=;decimalPrecision=0;showValues=0;formatNumberScale=0;labelStep={$Step};numvdivlines={$divideV};rotateNames=1;yAxisMinValue=0;yAxisMaxValue=10;numDivLines=9;showAlternateHGridColor=1;alternateHGridAlpha=5;alternateHGridColor='CC3300'";
# Set chart attributes
$FC->setChartParams($strParam);
foreach ($SendStatusArr as $key => $data) {
$FC->addCategory($data['Time']);
}
$FC->addDataset("发送数量");
foreach ($SendStatusArr as $key => $data) {
$FC->addChartData($data['SendCount']);
}
$page_title = "Socket队列发送情况";
$page_form_action = $sign;
//调取模板
include $this->tpl('Config_SocketQueue_SendStatus');
}
示例7: getChart
function getChart()
{
// Include PHP Class
include(JPATH_SITE.DS.'components'.DS.'com_fabrik'.DS.'plugins'.DS.'visualization'.DS.'fusion_gantt_chart'.DS.'lib'.DS.'FCclass'.DS.'FusionCharts_Gen.php');
// Add JS to page header
$document = JFactory::getDocument();
$document->addScript($this->srcBase."fusion_gantt_chart/lib/FCCharts/FusionCharts.js");
$params = $this->getParams();
$w = $params->get('fusion_gantt_chart_width');
$h = $params->get('fusion_gantt_chart_height');
// Create new chart
$FC = new FusionCharts("GANTT","$w","$h");
// Define path to FC's SWF
$FC->setSWFPath($this->srcBase."fusion_gantt_chart/lib/FCCharts/");
$FC->setChartParam('dateFormat', 'yyyy-mm-dd');
$FC->setChartParam('showTaskNames', 1);
$FC->setChartParams('ganttWidthPercent=70;gridBorderAlpha=100;canvasBorderColor=333333;canvasBorderThickness=0;hoverCapBgColor=FFFFFF;hoverCapBorderColor=333333;extendcategoryBg=0;ganttLineColor=99cc00;ganttLineAlpha=20;baseFontColor=333333;gridBorderColor=99cc00');
// ------------------- Setting Param string
$listid = $params->get('fusion_gantt_chart_table');
$listModel = JModel::getInstance('list', 'FabrikFEModel');
$listModel->setId($listid);
$db = $listModel->getDB();
$table = $listModel->getTable()->db_table_name;
$process = $params->get('fusion_gantt_chart_process');
$processraw = $process.'_raw';
$start = $params->get('fusion_gantt_chart_startdate');
$startraw = $start .'_raw';
$end = $params->get('fusion_gantt_chart_enddate');
$endraw = $end . '_raw';
$label = $params->get('fusion_gantt_chart_label');
$hover = $params->get('fusion_gantt_chart_hover');
$milestone = $params->get('fusion_gantt_chart_milestone');
$milestoneraw = $milestone."_raw";
$connector = $params->get('fusion_gantt_chart_connector');
$connectorraw = $connector."_raw";
$fields = array();
$fields[] = FabrikString::safeColName($process)." AS " . $db->nameQuote($process);
$fields[] = FabrikString::safeColName($start)." AS " . $db->nameQuote($start);
$fields[] = FabrikString::safeColName($end)." AS " . $db->nameQuote($end);
$fields[] = FabrikString::safeColName($label)." AS " . $db->nameQuote($label);
if ($hover !== '') {
$fields[] = FabrikString::safeColName($hover)." AS " . $db->nameQuote($hover);
}
if ($milestone !== '') {
$fields[] = FabrikString::safeColName($milestone)." AS " . $db->nameQuote($milestone);
}
if ($connector !== '') {
$fields[] = FabrikString::safeColName($connector)." AS " . $db->nameQuote($connector);
}
$listModel->asfields = $fields;
$nav = $listModel->getPagination(0, 0, 0);
$data = $listModel->getData();
$data = $data[0];
$mindate = null;
$maxdate = null;
$usedProcesses = array();
$milestones = array();
$connectors = array();
$processLabel = $params->get('fusion_gantt_chart_process_label');
$FC->setGanttProcessesParams("positionInGrid=right;align=center;headerText=$processLabel;fontColor=333333;fontSize=11;isBold=1;isAnimated=1;bgColor=99cc00;headerbgColor=333333;headerFontColor=99cc00;headerFontSize=16;bgAlpha=40");
foreach ($data as $d) {
$hovertext = $hover == '' ? '' : $d->$hover;
$processid = $d->$processraw;
$startdate = JFactory::getDate($d->$startraw);
$enddate = JFactory::getDate($d->$endraw);
$strParam = "start=".$startdate->toFormat('%Y/%m/%d').";end=".$enddate->toFormat('%Y/%m/%d').";processId={$processid};id={$d->__pk_val};color=99cc00;alpha=60;topPadding=19;hoverText={$hovertext};";
$strParam .="link={$d->fabrik_view_url};";
$FC->addGanttTask($FC->encodeSpecialChars($d->$label), $strParam);
if ($milestone !== '' && $d->$milestoneraw == 1) {
$FC->addGanttMilestone($d->__pk_val, "date=".$enddate->toFormat('%Y/%m/%d').";radius=10;color=333333;shape=Star;numSides=5;borderThickness=1");
}
if ($connector !== '' && $d->$connectorraw !== '') {
$FC->addGanttConnector($d->$connectorraw, $d->__pk_val, "color=99cc00;thickness=2;");
}
#apply processes
if (!in_array($processid, $usedProcesses)) {
$usedProcesses[] = $processid;
$FC->addGanttProcess($FC->encodeSpecialChars($d->$process), "id={$processid};");
}
#increaes max/min date range
if (is_null($mindate)) {
$mindate = $startdate;
$maxdate = $enddate;
} else {
if (JFactory::getDate($d->$startraw)->toUnix() < $mindate->toUnix()) {
$mindate = JFactory::getDate($d->$startraw);
//.........这里部分代码省略.........
示例8: fs_gantt_chart
function fs_gantt_chart($title, $from, $to, $tasks, $milestones, $width, $height)
{
// Generate the XML
$chart = new FusionCharts("Gantt", $width, $height, "1", "0");
$chart->setSWFPath("include/graphs/FusionCharts/");
$chart->setChartParams('dateFormat=dd/mm/yyyy;hoverCapBorderColor=2222ff;hoverCapBgColor=e1f5ff;ganttLineAlpha=80;canvasBorderColor=024455;canvasBorderThickness=0;gridBorderColor=2179b1;gridBorderAlpha=20;ganttWidthPercent=80');
$chart->setGanttProcessesParams('headerText=' . __('Task') . ';fontColor=ffffff;fontSize=9;isBold=1;isAnimated=1;bgColor=2179b1;headerbgColor=2179b1;headerFontColor=ffffff;headerFontSize=12;align=left');
$chart->setGanttTasksParams('');
$start_date = explode('/', $from);
$start_day = $start_date[0];
$start_month = $start_date[1];
$start_year = $start_date[2];
$end_date = explode('/', $to);
$end_day = $end_date[0];
$end_month = $end_date[1];
$end_year = $end_date[2];
$time_span = date_to_epoch($to) - date_to_epoch($from);
// Years
$chart->addGanttCategorySet('bgColor=2179b1;fontColor=ff0000');
for ($i = $start_year; $i <= $end_year; $i++) {
if ($i == $start_year) {
$start = sprintf('%02d/%02d/%04d', $start_day, $start_month, $start_year);
} else {
$start = sprintf('%02d/%02d/%04d', 1, 1, $i);
}
if ($i == $end_year) {
$end = sprintf('%02d/%02d/%04d', $end_day, $end_month, $end_year);
} else {
$end = sprintf('%02d/%02d/%04d', cal_days_in_month(CAL_GREGORIAN, 12, $i), 12, $i);
}
$chart->addGanttCategory($i, ';start=' . $start . ';end=' . $end . ';align=center;fontColor=ffffff;isBold=1;fontSize=16');
}
// Months
$chart->addGanttCategorySet('bgColor=ffffff;fontColor=1288dd;fontSize=10');
for ($i = $start_year; $i <= $end_year; $i++) {
for ($j = 1; $j <= 12; $j++) {
if ($i == $start_year && $j < $start_month) {
continue;
} else {
if ($i == $end_year && $j > $end_month) {
break;
}
}
if ($i == $start_year && $j == $start_month) {
$start = sprintf('%02d/%02d/%04d', $start_day, $start_month, $start_year);
} else {
$start = sprintf('%02d/%02d/%04d', 1, $j, $i);
}
if ($i == $end_year && $j == $end_month) {
$end = sprintf('%02d/%02d/%04d', $end_day, $end_month, $end_year);
} else {
$end = sprintf('%02d/%02d/%04d', cal_days_in_month(CAL_GREGORIAN, $j, $i), $j, $i);
}
$chart->addGanttCategory(date('F', mktime(0, 0, 0, $j, 1)), ';start=' . $start . ';end=' . $end . ';align=center;isBold=1');
}
}
// Days
if ($time_span < 2592000) {
$chart->addGanttCategorySet();
for ($i = $start_year; $i <= $end_year; $i++) {
for ($j = 1; $j <= 12; $j++) {
if ($i == $start_year && $j < $start_month) {
continue;
} else {
if ($i == $end_year && $j > $end_month) {
break;
}
}
$num_days = cal_days_in_month(CAL_GREGORIAN, $j, $i);
for ($k = 1; $k <= $num_days; $k++) {
if ($i == $start_year && $j == $start_month && $k < $start_day) {
continue;
} else {
if ($i == $end_year && $j == $end_month && $k > $end_day) {
break;
}
}
$start = sprintf('%02d/%02d/%04d', $k, $j, $i);
$end = sprintf('%02d/%02d/%04d', $k, $j, $i);
$chart->addGanttCategory($k, ';start=' . $start . ';end=' . $end . ';fontSize=8;isBold=0');
}
}
}
} else {
if ($time_span < 10368000) {
$chart->addGanttCategorySet();
for ($i = $start_year; $i <= $end_year; $i++) {
for ($j = 1; $j <= 12; $j++) {
if ($i == $start_year && $j < $start_month) {
continue;
} else {
if ($i == $end_year && $j > $end_month) {
break;
}
}
$num_days = cal_days_in_month(CAL_GREGORIAN, $j, $i);
for ($k = 1, $l = 1; $k <= $num_days; $k += 8, $l++) {
if ($i == $start_year && $j == $start_month && $k + 7 < $start_day) {
continue;
}
//.........这里部分代码省略.........
示例9: generateXML
/**
* Function generates an xml file for generating the chart
*
* @param string $sql
* @param array $strParam
*
* @return xml
*/
function generateXML($sql, $strParam)
{
include "../includes/FusionCharts_Gen.php";
$FC = new FusionCharts("Column3D", "900", "500");
$FC->setChartParams($strParam);
//$FC->AddColors("FF0000;00FF00;0000FF;FFFF00;FF00FF;FCAAAA");
$obj = new Bin_Query();
$arrdata = array();
if ($obj->executeQuery($sql)) {
$arr = $obj->records;
for ($i = 0; $i < count($arr); $i++) {
$arrdata[$i][0] = $arr[$i]['date'];
$arrdata[$i][1] = $arr[$i]['total'];
}
$FC->addChartDataFromArray($arrdata);
}
header('Content-type: text/xml');
$xml = $FC->getXML();
header('Content-type: text/html');
return $xml;
}
示例10: onrevokeComplainData
function onrevokeComplainData()
{
//只查询转为投诉的问题
$ConditionList['transformed'] = 1;
$action = "index.php?admin_complain/revokeComplainData";
$hasIntoComplainViewPrivilege = $_ENV['menu']->checkPermission($this->ask_login_name, $_SERVER['QUERY_STRING'], "intoRevokeComplainData");
$hasIntoComplainViewPrivilege['url'] = "?admin_main";
!$hasIntoComplainViewPrivilege['return'] && __msg($hasIntoComplainViewPrivilege);
$ConditionList['ComplainStartDate'] = isset($this->post['ComplainStartDate']) ? $this->post['ComplainStartDate'] : (isset($this->get[2]) ? $this->get[2] : date("Y-m-d", time() - 7 * 86400));
$ConditionList['ComplainEndDate'] = isset($this->post['ComplainEndDate']) ? $this->post['ComplainEndDate'] : (isset($this->get[3]) ? $this->get[3] : date("Y-m-d", time()));
$ConditionList['author'] = isset($this->post['author']) ? urldecode(trim($this->post['author'])) : (isset($this->get[4]) ? urldecode(trim($this->get[4])) : "");
$ConditionList['author_id'] = isset($this->post['author_id']) ? trim($this->post['author_id']) : (isset($this->get[5]) ? trim($this->get[5]) : "");
$ConditionList['operator_loginId'] = isset($this->post['operator_loginId']) ? trim($this->post['operator_loginId']) : (isset($this->get[6]) ? trim($this->get[6]) : "");
$ConditionList['jid'] = isset($this->post['jid']) ? intval($this->post['jid']) : (isset($this->get[7]) ? intval($this->get[7]) : 0);
$SellerTypeList = $this->ask_config->getSellerType();
$ConditionList['sid'] = isset($this->post['sid']) ? intval($this->post['sid']) : (isset($this->get[8]) ? intval($this->get[8]) : -1);
$J = $this->cache->get("Jlist_" . $ConditionList['sid']);
if (false !== $J) {
$Jlist = json_decode($J, true);
} else {
$Jlist = $_ENV['complain']->getJList($ConditionList['sid']);
$this->cache->set("Jlist_" . $ConditionList['sid'], json_encode($Jlist), 1800);
}
$ConditionList['status'] = 2;
$ConditionList['Assess'] = -1;
$ConditionList['reason'] = isset($this->post['reason']) ? urldecode(trim($this->post['reason'])) : (isset($this->get[9]) ? urldecode(trim($this->get[9])) : "");
$export = trim($this->get[10]) == "export" ? 1 : 0;
$pagesize = $this->setting['list_default'];
$pagesize = 20;
$complainData = $_ENV['complain']->getRevokeComplainData($ConditionList);
$downloadstr = page_url("<下载EXCEL表格>", "admin_complain/revokeComplainData/" . $ConditionList['ComplainStartDate'] . "/" . $ConditionList['ComplainEndDate'] . "/" . urlencode($ConditionList['author']) . "/" . $ConditionList['author_id'] . "/" . $ConditionList['operator_loginId'] . "/" . $ConditionList['jid'] . "/" . $ConditionList['sid'] . "/" . $ConditionList['reason'] . "/export");
if (!$export) {
$msg && ($message = $msg);
$ty && ($type = $ty);
# Include FusionCharts PHP Class
include TIPASK_ROOT . '/lib/fusion/Includes/FusionCharts_Gen.php';
$FC2 = new FusionCharts("Pie2d", '100%', '400');
$FC2->setSWFPath('../Charts/');
$strParam = "caption='撤销理由统计';xAxisName='理由';baseFontSize=12;numberPrefix=;numberSuffix=次;decimalPrecision=0;showValues=1;formatNumberScale=0;rotateNames=0;numDivLines=9;showAlternateHGridColor=1;alternateHGridAlpha=5;alternateHGridColor='CC3300';hoverCapSepChar=,";
$FC2->setChartParams($strParam);
$FC2->addDataset("撤销理由");
foreach ($complainData['RevokeReasonList'] as $r => $data) {
$complainData['RevokeReasonList'][$r]['rate'] = $complainData['totalData']['complainCount'] > 0 ? $data['revokeCount'] / $complainData['totalData']['complainCount'] : 0;
$FC2->addChartData($data['revokeCount'], 'name="' . $data['content'] . '"');
}
$FC3 = new FusionCharts("Pie2d", '100%', '400');
$FC3->setSWFPath('../Charts/');
$strParam = "caption='交易类型统计';xAxisName='交易类型';baseFontSize=12;numberPrefix=;numberSuffix=次;decimalPrecision=0;showValues=1;formatNumberScale=0;rotateNames=0;numDivLines=9;showAlternateHGridColor=1;alternateHGridAlpha=5;alternateHGridColor='CC3300';hoverCapSepChar=,";
$FC3->setChartParams($strParam);
$FC3->addDataset("交易类型");
$jlist = $_ENV['complain']->getJList(0);
unset($jlist[0]);
foreach ($complainData['jList'] as $j => $data) {
$complainData['jList'][$j]['jName'] = isset($jlist[$j]) ? $jlist[$j] : "未定义交易类型" . $j;
$complainData['jList'][$j]['rate'] = $complainData['totalData']['complainCount'] > 0 ? $data['revokeCount'] / $complainData['totalData']['complainCount'] : 0;
$FC3->addChartData($data['revokeCount'], "name=" . $complainData['jList'][$j]['jName']);
}
$FC4 = new FusionCharts("Pie2d", '100%', '400');
$FC4->setSWFPath('../Charts/');
$strParam = "caption='用户身份类型统计';xAxisName='身份类型';baseFontSize=12;numberPrefix=;numberSuffix=次;decimalPrecision=0;showValues=1;formatNumberScale=0;rotateNames=0;numDivLines=9;showAlternateHGridColor=1;alternateHGridAlpha=5;alternateHGridColor='CC3300';hoverCapSepChar=,";
$FC4->setChartParams($strParam);
$FC4->addDataset("身份类型");
$SellerTypeList = $this->ask_config->getSellerType();
unset($slist[0]);
foreach ($complainData['sList'] as $s => $data) {
$complainData['sList'][$s]['sName'] = isset($SellerTypeList[$s]) ? $SellerTypeList[$s] : "未定义身份类型" . $s;
$complainData['sList'][$s]['rate'] = $complainData['totalData']['complainCount'] > 0 ? $data['revokeCount'] / $complainData['totalData']['complainCount'] : 0;
$FC4->addChartData($data['revokeCount'], "name=" . $complainData['sList'][$s]['sName']);
}
} else {
set_time_limit(0);
require TIPASK_ROOT . '/lib/Excel.php';
$oExcel = new Excel();
$FileName = '已撤销投诉统计下载';
$oExcel->download($FileName);
$oExcel->addSheet('撤销理由统计');
//标题栏
$title = array("撤销理由", "撤销次数", "问题占比");
$oExcel->addRows(array($title));
foreach ($complainData['RevokeReasonList'] as $r => $data) {
$excelArr = array();
$excelArr = array("reason" => $data['content'], "revokeCount" => $data['revokeCount'], "rate" => $complainData['totalData']['complainCount'] > 0 ? $data['revokeCount'] / $complainData['totalData']['complainCount'] : 0);
$oExcel->addRows(array($excelArr));
}
$oExcel->closeSheet();
$oExcel->addSheet('交易类型统计');
//标题栏
$title = array("交易类型", "撤销次数", "问题占比");
$oExcel->addRows(array($title));
$jlist = $_ENV['complain']->getJList(0);
unset($jlist[0]);
foreach ($complainData['jList'] as $j => $data) {
$excelArr = array();
$excelArr = array("jname" => isset($jlist[$j]) ? $jlist[$j] : "未定义交易类型" . $j, "revokeCount" => $data['revokeCount'], "rate" => $complainData['totalData']['complainCount'] > 0 ? $data['revokeCount'] / $complainData['totalData']['complainCount'] : 0);
$oExcel->addRows(array($excelArr));
}
$oExcel->closeSheet();
$oExcel->addSheet('身份类型统计');
//标题栏
$title = array("身份类型", "撤销次数", "问题占比");
//.........这里部分代码省略.........
示例11: FusionCharts
function confirm_complete()
{
$FC = new FusionCharts();
$totalGigs = $this->consultants->confirmGigs();
$gigsByMonth = array();
foreach ($totalGigs as $tg) {
$marr = explode("-", $tg->eventDate);
$gigsByMonth[$marr[1]][] = $tg;
}
$monthsArr = array("1" => "Jan", "2" => "Feb", "3" => "Mar", "4" => "Apr", "5" => "May", "6" => "Jun", "7" => "Jul", "8" => "Aug", "9" => "Sep", "10" => "Oct", "11" => "Nov", "12" => "Dec");
// specify the graph parameters
$strParam = "caption=Total Gigs- Monthly ;xAxisName=Month;yAxisName=Total gigs;decimalPrecision=0;formatNumberScale=1";
$FC->setChartParams($strParam);
for ($i = 1; $i <= 12; $i++) {
$total = isset($gigsByMonth[$i]) ? count($gigsByMonth[$i]) : 0;
$FC->addChartData($total, "name=" . $monthsArr[$i]);
}
print $FC->getXML();
}
示例12: onresponseDayDataStacked
function onresponseDayDataStacked($msg = '', $ty = '')
{
//只查询转为投诉的问题
$action = "index.php?admin_data/responseDayDataStacked";
$hasIntoResponseDayStackedDataPrivilege = $_ENV['menu']->checkPermission($this->ask_login_name, $_SERVER['QUERY_STRING'], "intoResponseDayStackedData");
$hasIntoResponseDayStackedDataPrivilege['url'] = "?admin_main";
!$hasIntoResponseDayStackedDataPrivilege['return'] && __msg($hasIntoResponseDayStackedDataPrivilege);
$ConditionList['StartDate'] = isset($this->post['StartDate']) ? $this->post['StartDate'] : (isset($this->get[2]) ? $this->get[2] : date("Y-m-d", time() - 86400));
$ConditionList['EndDate'] = isset($this->post['EndDate']) ? $this->post['EndDate'] : (isset($this->get[3]) ? $this->get[3] : date("Y-m-d", time() - 86400));
$DepartmentList = $_ENV['department']->get_list();
$ConditionList['DepartmentId'] = isset($this->post['DepartmentId']) ? intval($this->post['DepartmentId']) : (isset($this->get[4]) ? intval($this->get[4]) : 0);
$QtypeList = $_ENV['qtype']->GetAllQType(0, '', 0);
$ConditionList['QtypeId'] = 0;
$export = trim($this->get[6]) == "export" ? 1 : 0;
if (!$export) {
$ResponseDayArr = $_ENV['question']->getResponseDay($ConditionList);
foreach ($QtypeList as $Key => $QtypeInfo) {
foreach ($ResponseDayArr as $Hour => $data) {
if (!isset($data['QtypeDetail'][$QtypeInfo['id']])) {
$ResponseDayArr[$Hour]['QtypeDetail'][$QtypeInfo['id']]['ReceiveCount'] = 0;
}
ksort($ResponseDayArr[$Hour]['QtypeDetail']);
}
}
include TIPASK_ROOT . '/lib/fusion/Includes/FusionCharts_Gen.php';
# Create Multiseries ColumnD chart object using FusionCharts PHP Class
$FC = new FusionCharts("StackedColumn2D", '1200', '400');
# Set the relative path of the swf file
$FC->setSWFPath('../Charts/');
# Store chart attributes in a variable
$strParam = "caption='客服响应数据';xAxisName='时间段';baseFontSize=12;decimalPrecision=0;showValues=0;formatNumberScale=0;labelStep=1;numvdivlines={$divideV};rotateNames=0;yAxisMinValue=0;yAxisMaxValue=10;numDivLines=9;showAlternateHGridColor=1;alternateHGridAlpha=5;alternateHGridColor='CC3300';pYAxisName=客服;sYAxisName=客服响应数据;hoverCapSepChar=,";
# Set chart attributes
$FC->setChartParams($strParam);
foreach ($ResponseDayArr as $Hour => $data) {
$FC->addCategory($Hour . ":00");
}
foreach ($QtypeList as $Key => $QtypeInfo) {
$FC->addDataset($QtypeInfo['name']);
foreach ($ResponseDayArr as $Hour => $data) {
$FC->addChartData($data['QtypeDetail'][$QtypeInfo['id']]['ReceiveCount']);
}
}
$downloadstr = page_url("<下载EXCEL表格>", "admin_data/responseDayDataStacked/" . $ConditionList['StartDate'] . "/" . $ConditionList['EndDate'] . "/" . $ConditionList['DepartmentId'] . "/" . $ConditionList['QtypeId'] . "/export");
$msg && ($message = $msg);
$ty && ($type = $ty);
} else {
set_time_limit(0);
require TIPASK_ROOT . '/lib/Excel.php';
$oExcel = new Excel();
$FileName = $ConditionList['Date'] . '客服响应数据';
$oExcel->download($FileName)->addSheet('客服响应数据');
//标题栏
$title = array("时间段");
ksort($QtypeList);
foreach ($QtypeList as $Key => $QtypeInfo) {
$title[] = $QtypeInfo['name'];
}
$oExcel->addRows(array($title));
$ResponseDayArr = $_ENV['question']->getResponseDay($ConditionList);
foreach ($ResponseDayArr as $Hour => $HourInfo) {
$excelArr = array("Hour" => $Hour . ":00");
ksort($HourInfo['QtypeDetail']);
foreach ($QtypeList as $Key => $QtypeInfo) {
$excelArr[$Key] = intval($HourInfo['QtypeDetail'][$Key]['ReceiveCount']);
}
$oExcel->addRows(array($excelArr));
}
$oExcel->closeSheet()->close();
}
include template('responseDayStacked', 'admin');
}