当前位置: 首页>>代码示例>>PHP>>正文


PHP FusionCharts::addCategory方法代码示例

本文整理汇总了PHP中FusionCharts::addCategory方法的典型用法代码示例。如果您正苦于以下问题:PHP FusionCharts::addCategory方法的具体用法?PHP FusionCharts::addCategory怎么用?PHP FusionCharts::addCategory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FusionCharts的用法示例。


在下文中一共展示了FusionCharts::addCategory方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: FusionCharts

<?php

# Include FusionCharts PHP Class
include "../Class/FusionCharts_Gen.php";
# Create Bubble chart Object
$FC = new FusionCharts("bubble", "450", "350");
# set the relative path of the swf file
$FC->setSwfPath("../FusionCharts/");
# Define chart attributes
$strParam = "caption=Monthly Sales;xAxisName=Number of Products;yAxisName=Revenue;numberPrefix=\$";
# Set chart attributes
$FC->setChartParams($strParam);
# Add Category, 1st parameter take label and 2nd parameter takes x axis value
# as parameter list
$FC->addCategory("0", "x=0;showVerticalLine=1");
$FC->addCategory("20", "x=20;showVerticalLine=1");
$FC->addCategory("40", "x=40;showVerticalLine=1");
$FC->addCategory("60", "x=60;showVerticalLine=1");
$FC->addCategory("80", "x=80;showVerticalLine=1");
$FC->addCategory("100", "x=100;showVerticalLine=1");
# Add a new dataset
$FC->addDataSet("Previous Month");
# Add chart data for the above dataset
# where 1st parameter for X axis value
# 2nd parameter take Y and Z axis as parameter list
# e.g y=12200;z=10
$FC->addChartData("20", "y=72000;z=8");
$FC->addChartData("43", "y=42000;z=5");
$FC->addChartData("70", "y=90000;z=2");
$FC->addChartData("90", "y=75000;z=4");
# Add another dataset
开发者ID:tyxing007,项目名称:pet-service,代码行数:31,代码来源:BubbleChart.php

示例2: FusionCharts

<?php

# Include FusionCharts PHP Class
include "../Class/FusionCharts_Gen.php";
# Create Scatter chart Object
$FC = new FusionCharts("Scatter", "300", "250");
# set the relative path of the swf file
$FC->setSwfPath("../FusionCharts/");
# Define chart attributes
$strParam = "caption=Server Performance;yAxisName=Response Time (sec);xAxisName=Server Load (TPS)";
# Set chart attributes
$FC->setChartParams($strParam);
# Add Category, 1st parameter take label and 2nd parameter takes x axis value
# as parameter list
$FC->addCategory("10", "x=10;showVerticalLine=1");
$FC->addCategory("20", "x=20;showVerticalLine=1");
$FC->addCategory("30", "x=30;showVerticalLine=1");
$FC->addCategory("40", "x=40;showVerticalLine=1");
$FC->addCategory("50", "x=50");
# Add a new dataset
$FC->addDataSet("Server 1", "anchorRadius=6");
# Add chart data for the above dataset
# where 1st parameter for X axis value
# 2nd parameter take Y axis as parameter list
# e.g y=27
$FC->addChartData("21", "y=2.4");
$FC->addChartData("32", "y=3.5");
$FC->addChartData("43", "y=2.5");
$FC->addChartData("48", "y=4.1");
# Add another dataset
$FC->addDataSet("Server 2", "anchorRadius=6");
开发者ID:bamcod,项目名称:Disease-Surveillance,代码行数:31,代码来源:ScatterChart.php

示例3: FusionCharts

<?php

# Include FusionCharts PHP Class
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");
开发者ID:bamcod,项目名称:Disease-Surveillance,代码行数:31,代码来源:CombinationChart.php

示例4: 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');
 }
开发者ID:eappl,项目名称:prototype,代码行数:87,代码来源:SocketQueueController.php

示例5: FusionCharts

<?php

# Include FusionCharts PHP Class
include "../Class/FusionCharts_Gen.php";
# Create Multiseries Stacked Column2D Line DY object using FusionCharts PHP Class
$FC = new FusionCharts("MSStackedColumn2DLineDY", "450", "350");
# Set the relative path of the swf file
$FC->setSWFPath("../FusionCharts/");
# Define chart attributes
$strParam = "caption=Annual Revenue;rotateValues=1;xAxisName=Year;PYAxisName=Revenue;SYAXisName=Cost as %25 of Revenue;numberPrefix=\$;numberSuffix=M;sNumberSuffix=%25;SYAxisMinValue=0;SYAxisMaxValue=100;showValues=0;useroundedges=1;showSum=1";
# Set chart attributes
$FC->setChartParams($strParam);
# Add category names
$FC->addCategory("2001");
$FC->addCategory("2002");
$FC->addCategory("2003");
$FC->addCategory("2004");
$FC->addCategory("2005");
# Add Multi-series  Dataset
$FC->createMSStDataset();
# Add Multi-series dataset with in dataset
$FC->addMSStSubDataset("Product A", "");
# Add set data for plotting the chart
$FC->addChartData("30");
$FC->addChartData("26");
$FC->addChartData("29");
$FC->addChartData("31");
$FC->addChartData("34");
# Add Multi-series dataset with in dataset
$FC->addMSStSubDataset("Product B", "");
# Add set data for plotting the chart
开发者ID:bamcod,项目名称:Disease-Surveillance,代码行数:31,代码来源:MSStackedColumn2DLineDYChart.php

示例6: fs_2d_hcolumn_chart

function fs_2d_hcolumn_chart($data, $width, $height)
{
    if (sizeof($data) == 0) {
        return;
    }
    // Generate the XML
    $chart = new FusionCharts('Bar2D', $width, $height);
    $pixels_between_xdata = 25;
    $max_xdata_display = round($width / $pixels_between_xdata);
    $ndata = count($data);
    if ($max_xdata_display > $ndata) {
        $xdata_display = $ndata;
    } else {
        $xdata_display = $max_xdata_display;
    }
    $step = round($ndata / $xdata_display);
    if (is_array(reset($data))) {
        $data2 = array();
        $count = 0;
        foreach ($data as $i => $values) {
            $count++;
            $show_name = '0';
            if ($count % $step == 0) {
                $show_name = '1';
            }
            $chart->addCategory($i, 'hoverText=' . $i . ';showName=' . $show_name);
            $c = 0;
            foreach ($values as $i2 => $value) {
                $data2[$i2][$i] = $value;
                $c++;
            }
        }
        $data = $data2;
    } else {
        $data = array($data);
    }
    $empty = 0;
    $num_vlines = 0;
    $count = 0;
    foreach ($data as $legend_value => $values) {
        foreach ($values as $name => $value) {
            if ($count++ % $step == 0) {
                $show_name = '1';
                $num_vlines++;
            } else {
                $show_name = '0';
            }
            if ($value > 0) {
                $empty = 0;
            }
            $chart->addChartData($value, 'name=' . clean_flash_string($name) . ';showName=' . $show_name);
        }
    }
    $params = 'showNames=1;showValues=0;showPercentageValues=0;baseFontSize=9;rotateNames=1;chartLeftMargin=0;chartRightMargin=0;chartBottomMargin=0;chartTopMargin=0;showBarShadow=1;showLimits=1';
    $chart->setChartParams($params . ';numVDivLines=' . $num_vlines . ($empty == 1 ? ';yAxisMinValue=0;yAxisMaxValue=1' : ''));
    // Return the code
    return get_chart_code($chart, $width, $height, 'include/graphs/FusionCharts/FCF_Bar2D.swf');
}
开发者ID:articaST,项目名称:integriaims,代码行数:58,代码来源:functions_fsgraph.php

示例7: FusionCharts

<?php

# Include FusionCharts PHP Class
include "../Class/FusionCharts_Gen.php";
# Create Multiseries Column3D chart object using FusionCharts PHP Class
$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");
开发者ID:bamcod,项目名称:Disease-Surveillance,代码行数:31,代码来源:MultiSeriesChart_Vline.php

示例8: oncomplainData

 function oncomplainData()
 {
     //只查询转为投诉的问题
     $ConditionList['transformed'] = 1;
     $action = "index.php?admin_complain/complainData";
     $hasIntoComplainViewPrivilege = $_ENV['menu']->checkPermission($this->ask_login_name, $_SERVER['QUERY_STRING'], "intoComplainData");
     $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['AnswerStartDate'] = 0;
     $ConditionList['AnswerEndDate'] = 0;
     $ConditionList['author'] = isset($this->post['author']) ? urldecode(trim($this->post['author'])) : (isset($this->get[6]) ? urldecode(trim($this->get[6])) : "");
     $ConditionList['author_id'] = isset($this->post['author_id']) ? trim($this->post['author_id']) : (isset($this->get[7]) ? trim($this->get[7]) : "");
     $ConditionList['operator_loginId'] = isset($this->post['operator_loginId']) ? trim($this->post['operator_loginId']) : (isset($this->get[8]) ? trim($this->get[8]) : "");
     $ConditionList['jid'] = isset($this->post['jid']) ? intval($this->post['jid']) : (isset($this->get[9]) ? intval($this->get[9]) : 0);
     $SellerTypeList = $this->ask_config->getSellerType();
     $ConditionList['sid'] = isset($this->post['sid']) ? intval($this->post['sid']) : (isset($this->get[12]) ? intval($this->get[12]) : -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);
     }
     $statusList = $this->ask_config->getComStatus();
     $ConditionList['status'] = isset($this->post['status']) ? intval($this->post['status']) : (isset($this->get[10]) ? intval($this->get[10]) : -2);
     $assessStatusList = $this->ask_config->getComAssessStatus();
     $ConditionList['Assess'] = isset($this->post['Assess']) ? intval($this->post['Assess']) : (isset($this->get[11]) ? intval($this->get[11]) : -1);
     $export = trim($this->get[13]) == "export" ? 1 : 0;
     $pagesize = $this->setting['list_default'];
     $pagesize = 20;
     $complainData = $_ENV['complain']->getComplainData($ConditionList);
     $downloadstr = page_url("<下载EXCEL表格>", "admin_complain/complainData/" . $ConditionList['ComplainStartDate'] . "/" . $ConditionList['ComplainEndDate'] . "/" . $ConditionList['AnswerStartDate'] . "/" . $ConditionList['AnswerEndDate'] . "/" . urlencode($ConditionList['author']) . "/" . $ConditionList['author_id'] . "/" . $ConditionList['operator_loginId'] . "/" . $ConditionList['jid'] . "/" . $ConditionList['status'] . "/" . $ConditionList['Assess'] . "/" . $ConditionList['sid'] . "/export");
     if (!$export) {
         $msg && ($message = $msg);
         $ty && ($type = $ty);
         # Include FusionCharts PHP Class
         include TIPASK_ROOT . '/lib/fusion/Includes/FusionCharts_Gen.php';
         # Create Multiseries ColumnD chart object using FusionCharts PHP Class
         $FC = new FusionCharts("MSLine", '100%', '400');
         # Set the relative path of the swf file
         $FC->setSWFPath('../Charts/');
         $Step = 3;
         # Store chart attributes in a variable
         $strParam = "caption='每日用户投诉统计';xAxisName='日期';baseFontSize=12;numberPrefix=;numberSuffix=次;decimalPrecision=0;showValues=0;formatNumberScale=0;labelStep=" . $Step . ";numvdivlines={$divideV};rotateNames=1;yAxisMinValue=0;yAxisMaxValue=10;numDivLines=9;showAlternateHGridColor=1;alternateHGridAlpha=5;alternateHGridColor='CC3300';hoverCapSepChar=,";
         # Set chart attributes
         $FC->setChartParams($strParam);
         foreach ($complainData['date'] as $date => $data) {
             $FC->addCategory($date);
         }
         $FC->addDataset("投诉次数");
         foreach ($complainData['date'] as $date => $data) {
             // $paramset="link=" . urlencode($FC->getLinkFromPattern($data,'http://www.google.com'));
             // $FC->addChartData($data['complainCount'],$paramset);
             $FC->addChartData($data['complainCount']);
         }
         foreach ($assessStatusList as $key => $value) {
             if ($key >= 0) {
                 $FC->addDataset($value);
                 foreach ($complainData['date'] as $date => $data) {
                     // $paramset="link=" . urlencode($FC->getLinkFromPattern($data,'http://www.google.com'));
                     // $FC->addChartData($data['complainCount'],$paramset);
                     if (!isset($data['assess'][$key])) {
                         $complainData['date'][$date]['assess'][$key]['complainCount'] = 0;
                     }
                     ksort($complainData['date'][$date]['assess']);
                     $FC->addChartData($complainData['date'][$date]['assess'][$key]['complainCount']);
                 }
             }
         }
         $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("交易类型");
         $jlist = $_ENV['complain']->getJList(0);
         unset($jlist[0]);
         foreach ($complainData['jid'] as $j => $data) {
             $complainData['jid'][$j]['jName'] = isset($jlist[$j]) ? $jlist[$j] : "未定义交易类型" . $j;
             $complainData['jid'][$j]['rate'] = $complainData['totalData']['complainCount'] > 0 ? $data['complainCount'] / $complainData['totalData']['complainCount'] : 0;
             $FC2->addChartData($data['complainCount'], "name=" . $complainData['jid'][$j]['jName']);
         }
     } else {
         set_time_limit(0);
         require TIPASK_ROOT . '/lib/Excel.php';
         $oExcel = new Excel();
         $FileName = '投诉统计下载';
         $oExcel->download($FileName)->addSheet('交易类型统计');
         //标题栏
         $title = array("交易类型", "投诉次数", "问题占比");
         $oExcel->addRows(array($title));
         $jlist = $_ENV['complain']->getJList(0);
         unset($jlist[0]);
         foreach ($complainData['jid'] as $j => $data) {
             $excelArr = array();
             $excelArr = array("sName" => isset($jlist[$j]) ? $jlist[$j] : "未定义交易类型", "complainCount" => $data['complainCount'], "rate" => $complainData['totalData']['complainCount'] > 0 ? $data['complainCount'] / $complainData['totalData']['complainCount'] : 0);
             $oExcel->addRows(array($excelArr));
         }
         $oExcel->closeSheet();
//.........这里部分代码省略.........
开发者ID:eappl,项目名称:prototype,代码行数:101,代码来源:complain.php

示例9: array

         mysql_free_result($result2);
     }
     mysql_close($dbh);
     $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}";
开发者ID:jprecht,项目名称:ppc-coach-tracker,代码行数:31,代码来源:graphs-guts.php

示例10: 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');
 }
开发者ID:eappl,项目名称:prototype,代码行数:71,代码来源:data.php


注:本文中的FusionCharts::addCategory方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。