本文整理汇总了PHP中FusionCharts::setSWFPath方法的典型用法代码示例。如果您正苦于以下问题:PHP FusionCharts::setSWFPath方法的具体用法?PHP FusionCharts::setSWFPath怎么用?PHP FusionCharts::setSWFPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FusionCharts
的用法示例。
在下文中一共展示了FusionCharts::setSWFPath方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: FusionCharts
function FusionCharts($chart_type = '', $width = "300", $height = "250")
{
require_once 'fusion/FusionCharts_Gen.php';
$FC = new FusionCharts($chart_type, $width, $height);
$FC->setSWFPath(base_url() . "chart/");
return $FC;
}
示例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: getFusionchart
function getFusionchart()
{
$document =& JFactory::getDocument();
$params =& $this->getParams();
$worker = new FabrikWorker();
$fc_version = $params->get('fusionchart_version', 'free_old');
if ($fc_version == 'free_22') {
require_once $this->pathBase . 'fusionchart' . DS . 'lib' . DS . 'FusionChartsFree' . DS . 'Code' . DS . 'PHPClass' . DS . 'Includes' . DS . 'FusionCharts_Gen.php';
$document->addScript($this->srcBase . "fusionchart/lib/FusionChartsFree/JSClass/FusionCharts.js");
$fc_swf_path = COM_FABRIK_LIVESITE . $this->srcBase . "fusionchart/lib/FusionChartsFree/Charts/";
} else {
if ($fc_version == 'pro_30') {
require_once $this->pathBase . 'fusionchart' . DS . 'lib' . DS . 'FusionCharts' . DS . 'Code' . DS . 'PHPClass' . DS . 'Includes' . DS . 'FusionCharts_Gen.php';
$document->addScript($this->srcBase . "fusionchart/lib/FusionCharts/Charts/FusionCharts.js");
$fc_swf_path = COM_FABRIK_LIVESITE . $this->srcBase . "fusionchart/lib/FusionCharts/Charts/";
} else {
require_once $this->pathBase . 'fusionchart' . DS . 'lib' . DS . 'FCclass' . DS . 'FusionCharts_Gen.php';
$document->addScript($this->srcBase . "fusionchart/lib/FCcharts/FusionCharts.js");
$fc_swf_path = COM_FABRIK_LIVESITE . $this->srcBase . "fusionchart/lib/FCcharts/";
}
}
$calc_prefixes = array('sum___', 'avg___', 'med___', 'cnt___');
$calc_prefixmap = array('sum___' => 'sums', 'avg___' => 'avgs', 'med___' => 'medians', 'cnt___' => 'count');
$w = $params->get('fusionchart_width');
$h = $params->get('fusionchart_height');
$chartType = $params->get('fusionchart_type');
// Create new chart
$FC = new FusionCharts("{$chartType}", "{$w}", "{$h}");
//$FC->JSC["debugmode"]=true;
// Define path to FC's SWF
$FC->setSWFPath($fc_swf_path);
$this->setChartMessages($FC);
// Setting Param string
$strParam = $this->getChartParams();
$label_step_ratios = (array) $params->get('fusion_label_step_ratio');
$x_axis_label = (array) $params->get('fusion_x_axis_label');
$chartElements = (array) $params->get('fusionchart_elementList');
$chartColours = (array) $params->get('fusionchart_colours');
$listid = (array) $params->get('fusionchart_table');
$axisLabels = (array) $params->get('fusionchart_axis_labels');
foreach ($axisLabels as $axis_key => $axis_val) {
//$worker->replaceRequest($axis_val);
$axisLabels[$axis_key] = $worker->parseMessageForPlaceholder($axis_val, null, false);
}
$dual_y_parents = $params->get('fusionchart_dual_y_parent');
$measurement_units = (array) $params->get('fusion_x_axis_measurement_unit');
$legends = $params->get('fusiongraph_show_legend', '');
$chartWheres = (array) $params->get('fusionchart_where');
$c = 0;
$gdata = array();
$glabels = array();
$gcolours = array();
$gfills = array();
$max = array();
$min = array();
$calculationLabels = array();
$calculationData = array();
$calcfound = false;
$tmodels = array();
$labelStep = 0;
foreach ($listid as $tid) {
$min[$c] = 0;
$max[$c] = 0;
if (!array_key_exists($tid, $tmodels)) {
$listModel = null;
$listModel = JModel::getInstance('list', 'FabrikFEModel');
$listModel->setId($tid);
$tmodels[$tid] = $listModel;
} else {
$listModel = $tmodels[$tid];
}
$table = $listModel->getTable();
$form = $listModel->getForm();
// $$$ hugh - adding plugin query, 2012-02-08
if (array_key_exists($c, $chartWheres) && !empty($chartWheres[$c])) {
$chartWhere = $this->_replaceRequest($chartWheres[$c]);
$listModel->setPluginQueryWhere('fusionchart', $chartWhere);
} else {
// if no where clause, explicitly clear any previously set clause
$listModel->unsetPluginQueryWhere('fusionchart');
}
// $$$ hugh - remove pagination BEFORE calling render(). Otherwise render() applies
// session state/defaults when it calls getPagination, which is then returned as a cached
// object if we call getPagination after render(). So call it first, then render() will
// get our cached pagination, rather than vice versa.
$nav = $listModel->getPagination(0, 0, 0);
$listModel->render();
//$listModel->doCalculations();
$alldata = $listModel->getData();
$cals = $listModel->getCalculations();
$column = $chartElements[$c];
//$measurement_unit = $measurement_units[$c];
$measurement_unit = JArrayHelper::getValue($measurement_units, $c, '');
$pref = substr($column, 0, 6);
$label = JArrayHelper::getValue($x_axis_label, $c, '');
$tmpgdata = array();
$tmpglabels = array();
$colour = array_key_exists($c, $chartColours) ? str_replace("#", '', $chartColours[$c]) : '';
$gcolours[] = $colour;
if (in_array($pref, $calc_prefixes)) {
//.........这里部分代码省略.........
示例6: 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);
//.........这里部分代码省略.........
示例7: 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');
}
示例8: getFusionchart
function getFusionchart()
{
// Include PHP Class
require_once($this->pathBase.'fusionchart'.DS.'lib'.DS.'FCclass'.DS.'FusionCharts_Gen.php');
// Add JS to page header
$document = JFactory::getDocument();
$document->addScript($this->srcBase."fusionchart/lib/FCcharts/FusionCharts.js");
$params = $this->getParams();
$calc_prefixes = array('sum___', 'avg___', 'med___', 'cnt___');
$calc_prefixmap = array('sum___' => 'sums', 'avg___' => 'avgs', 'med___' => 'medians', 'cnt___' => 'count');
$w = $params->get('fusionchart_width');
$h = $params->get('fusionchart_height');
$chartType =$params->get('fusionchart_type');
// Create new chart
$FC = new FusionCharts("$chartType","$w","$h");
//$FC->JSC["debugmode"]=true;
// Define path to FC's SWF
$FC->setSWFPath($this->srcBase."fusionchart/lib/FCcharts/");
$this->setChartMessages($FC);
// ------------------- Setting Param string
$strParam = $this->getChartParams();
$x_axis_label = $params->get('fusion_x_axis_label', array(), '_default', 'array');
$chartElements = $params->get('fusionchart_elementList', array(), '_default', 'array');
$chartColours = $params->get('fusionchart_colours', array(), '_default', 'array');
$listid = $params->get('fusionchart_table', array(), '_default', 'array');
$axisLabels = $params->get('fusionchart_axis_labels', array(), '_default', 'array');
$measurement_units = $params->get('fusion_x_axis_measurement_unit', array(), '_default', 'array');
$legends = $params->get('fusiongraph_show_legend', '');
$c = 0;
$gdata = array();
$glabels = array();
$gcolours = array();
$gfills = array();
$max = 0;
$min = 0;
$calculationLabels = array();
$calculationData = array();
$calcfound = false;
$tmodels = array();
foreach ($listid as $tid) {
if (!array_key_exists($tid, $tmodels)) {
$listModel = null;
$listModel = JModel::getInstance('list', 'FabrikFEModel');
$listModel->setId($tid);
$tmodels[$tid] = $listModel;
} else {
$listModel = $tmodels[$tid];
}
$table = $listModel->getTable();
$form = $listModel->getForm();
//remove filters?
// $$$ hugh - remove pagination BEFORE calling render(). Otherwise render() applies
// session state/defaults when it calls getPagination, which is then returned as a cached
// object if we call getPagination after render(). So call it first, then render() will
// get our cached pagination, rather than vice versa.
$nav =& $listModel->getPagination(0, 0, 0);
$listModel->render();
//$listModel->doCalculations();
$alldata = $listModel->getData();
$cals = $listModel->getCalculations();
$column = $chartElements[$c];
//$measurement_unit = $measurement_units[$c];
$measurement_unit = JArrayHelper::getValue($measurement_units, $c, '');
$pref =substr($column, 0, 6);
$label = JArrayHelper::getValue($x_axis_label, $c, '');
$tmpgdata = array();
$tmpglabels = array();
//$colour = str_replace("#", '', $chartColours[$c]);
$colour = array_key_exists($c , $chartColours) ? str_replace("#", '', $chartColours[$c]) : '';
/* if ($fillGraphs) {
$c2 = $c + 1;
$gfills[] ='b,'. $colour . "," . $c . ",". $c2 .",0";
}
*/
$gcolours[] = $colour;
if (in_array($pref, $calc_prefixes)) {
// you shouldnt mix calculation elements with normal elements when creating the chart
// so if ONE calculation element is found we use the calculation data rather than normal element data
// this is because a calculation element only generates one value, if want to compare two averages then
//they get rendered as tow groups of data and on bar charts this overlays one average over the other, rather than next to it
$calcfound = true;
$column = substr($column, 6);
$calckey = $calc_prefixmap[$pref];
//.........这里部分代码省略.........
示例9: COUNT
$resforcharts = mysql_fetch_array($checkappforcharts);
$linkidforcharts = $resforcharts['id'];
$chart_traffic = mysql_query("select COUNT(DISTINCT ip) from idevaff_iptracking where acct_id = '{$linkidforcharts}'");
$chart_traffic = mysql_fetch_row($chart_traffic);
$chart_traffic = $chart_traffic[0];
$chart_approved = mysql_query("select COUNT(*) from idevaff_sales where approved = '1' and bonus = '0' and id = '{$linkidforcharts}'");
$chart_approved = mysql_fetch_row($chart_approved);
$chart_approved = $chart_approved[0];
$chart_paid = mysql_query("select COUNT(*) from idevaff_archive where bonus = '0' and id = '{$linkidforcharts}'");
$chart_paid = mysql_fetch_row($chart_paid);
$chart_paid = $chart_paid[0];
$chart_commissions = $chart_approved + $chart_paid;
$chart_traffic_tag = "Unique Hits";
$chart_commissions_tag = "Total Sales";
$FC = new FusionCharts("Column2D", "280", "180");
$FC->setSWFPath("templates/fusion/FusionCharts/");
$strParam = "showDivLineValue=0;canvasBorderColor=FFFFFF;formatNumberScale=0;formatNumber=1;animation=1;decimalPrecision=0;canvasBorderThickness=0;canvasBgColor=FFFFFF;canvasBaseColor=5c5c5c;canvasBaseDepth=1;baseFont=arial;baseFontSize=11;outCnvBaseFont=arial;outCnvBaseFontSze=11;showLegend=1";
$FC->setChartParams($strParam);
$FC->addChartData($chart_traffic, "name={$chart_traffic_tag}");
$FC->addChartData($chart_commissions, "name={$chart_commissions_tag}");
$FC->renderChart();
}
?>
</td>
</tr>
<tr>
<td width="30%" bgcolor="<?php
echo $this->_tpl_vars['white_back'];
?>
"> <?php
echo $this->_tpl_vars['general_transactions'];
开发者ID:ashfaqphplhr,项目名称:artificiallawnsforturf,代码行数:31,代码来源:%%CE^CE3^CE3E7A3F%%file%3Aaccount_general_stats.tpl.php
示例10: 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;
}
//.........这里部分代码省略.........
示例11: FusionCharts
<?php
/**
* Created by PhpStorm.
* User: Allan Wiz
* Date: 4/15/15
* Time: 5:03 PM
*/
require '../classes/aardb_conn.php';
//header('Content-Type: Text/xml');
include "../Charts/JSClass/FusionCharts.php";
include "../Charts/JSClass/FC_Colors.php";
include "../Charts/JSClass/FusionCharts_Gen.php";
global $session, $database;
global $conn;
$FC = new FusionCharts("MSLine", "300", "300");
$FC->setDataBaseType("oracle");
$FC->setSWFPath("../Charts/");
$strParam = "caption=INTEREST VIEW REPORT (for the last 14 days);subCaption=BY APPLICABLE DATE ; showNames='1';pieSliceDepth=30;showBorder=1;numberSuffix= %; formatNumberScale='0'; xAxisName=Date; pYAxisName=Net Asset Value;sYAxisName=BalancedFund";
$FC->setChartParams($strParam);
$start = date("d/M/Y", strtotime('-40 days'));
$today = date("d/M/Y");
$sql = "SELECT I_RATES.RATE_ID, I_RATES.RATE_DATE AS DATEY, I_RATES.RATE AS RATE, SECURITIES.DESCRIPT AS DESCRIPTION FROM I_RATES INNER JOIN\r SECURITIES ON I_RATES.SECURITY_CODE = SECURITIES.SECURITY_CODE WHERE I_RATES.CONFIRMD = 1 AND I_RATES.RATE_DATE BETWEEN '{$start}' AND '{$today}' ORDER BY I_RATES.RATE_DATE";
$result = oci_parse($conn, $sql) or die("");
oci_execute($result);
if ($result) {
// $FC->addCategoryFromDatabase($result,"DESCRIPTION");
// $FC->addDatasetsFromDatabase($result,"DESCRIPTION","RATE");
$FC->addDataFromDatabase($result, "RATE", "DATEY");
}
?>
示例12: 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("身份类型", "撤销次数", "问题占比");
//.........这里部分代码省略.........
示例13: 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');
}