本文整理汇总了PHP中FusionCharts::addDataset方法的典型用法代码示例。如果您正苦于以下问题:PHP FusionCharts::addDataset方法的具体用法?PHP FusionCharts::addDataset怎么用?PHP FusionCharts::addDataset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FusionCharts
的用法示例。
在下文中一共展示了FusionCharts::addDataset方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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');
}
示例2: FusionCharts
include "../Class/FusionCharts_Gen.php";
# Create Column 3D + Line Dual Y-Axis Combination Chart
$FC = new FusionCharts("MSColumn3DLineDY", "450", "350");
# Set the relative path of the swf file
$FC->setSWFPath("../FusionCharts/");
# Store chart attributes in a variable
$strParam = "caption=Weekly Sales;subcaption=Comparison;xAxisName=Week;pYAxisName=Revenue;sYAxisName=Total Quantity;numberPrefix=\$;sNumberSuffix= U";
# Set chart attributes
$FC->setChartParams($strParam);
# Add category names
$FC->addCategory("Week 1");
$FC->addCategory("Week 2");
$FC->addCategory("Week 3");
$FC->addCategory("Week 4");
# Add a new dataset with dataset parameters
$FC->addDataset("This Month", "showValues=0");
# Add chart data for the above dataset
$FC->addChartData("40800");
$FC->addChartData("31400");
$FC->addChartData("26700");
$FC->addChartData("54400");
# Add aother dataset with dataset parameters
$FC->addDataset("Previous Month", "showValues=0");
# Add chart data for the second dataset
$FC->addChartData("38300");
$FC->addChartData("28400");
$FC->addChartData("15700");
$FC->addChartData("48100");
# Add third dataset for the secondary axis
$FC->addDataset("Total Quantity", "parentYAxis=S");
# Add secondary axix's data values
示例3: FusionCharts
$FC = new FusionCharts("MSColumn2D", "450", "350");
# Set the relative path of the swf file
$FC->setSWFPath("../FusionCharts/");
# Define chart attributes
$strParam = "caption=Weekly Sales;subcaption=Comparison;xAxisName=Week;yAxisName=Revenue;numberPrefix=\$";
# Set chart attributes
$FC->setChartParams($strParam);
# Add category names
$FC->addCategory("Week 1");
# Add vline
$FC->addCategory("", "", "Color=FF0000");
$FC->addCategory("Week 2");
$FC->addCategory("Week 3");
$FC->addCategory("Week 4");
# Create a new dataset
$FC->addDataset("This Month");
# Add chart values for the above dataset
$FC->addChartData("40800");
$FC->addChartData("31400");
$FC->addChartData("26700");
$FC->addChartData("54400");
# Create second dataset
$FC->addDataset("Previous Month");
# Add chart values for the second dataset
$FC->addChartData("38300");
$FC->addChartData("28400");
$FC->addChartData("15700");
$FC->addChartData("48100");
?>
<html>
示例4: 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("身份类型", "撤销次数", "问题占比");
//.........这里部分代码省略.........
示例5: array
$FC->renderChart();
}
// end if type is clicks
if ($type == "rep") {
$categories = array("Revenue", "Expense");
$revenue = array();
$expense = array();
$FC = new FusionCharts("MSColumn3D", "800", "400");
$FC->setSwfPath("graphs/FusionCharts/");
$strParam = "caption=Revenue/Expense/Profit;xAxisName=Date/Time;yAxisName=\$;decimalPrecision=2; formatNumberScale=\$0.00; rotateNames=1";
$FC->setChartParams($strParam);
for ($i = $start_time; $i <= $end_time; $i += 86400) {
$FC->addCategory(date("d/m/Y", $i));
}
foreach ($categories as $cat) {
$FC->addDataset($cat);
if ($cat == "Revenue") {
$field_name = "revenue";
} elseif ($cat == "Expense") {
$field_name = "cost";
}
$dbh = mysql_connect($db_location, $username, $password);
// or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db($database);
$num = 0;
for ($i = $start_time; $i <= $end_time; $i += 86400) {
$end = $i + 86399;
$strQuery = "select sum({$field_name}) as TotOutput from kw_log where timestamp BETWEEN {$i} AND {$end}";
$result2 = mysql_query($strQuery) or die(mysql_error());
$ors2 = mysql_fetch_array($result2);
$FC->addChartData($ors2['TotOutput']);
示例6: 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');
}