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


PHP PieGraph::StrokeCSIM方法代码示例

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


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

示例1: array

<?php

include_once "../jpgraph.php";
include_once "../jpgraph_pie.php";
// Some data
$data = array(40, 21, 17, 14, 23);
// Create the Pie Graph.
$graph = new PieGraph(300, 200, 'auto');
$graph->SetShadow();
// Set A title for the plot
$graph->title->Set("Client side image map");
$graph->title->SetFont(FF_FONT1, FS_BOLD);
// Create
$p1 = new PiePlot($data);
$p1->SetCenter(0.4, 0.5);
$p1->SetLegends(array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul"));
$targ = array("pie_csimex1.php#1", "pie_csimex1.php#2", "pie_csimex1.php#3", "pie_csimex1.php#4", "pie_csimex1.php#5", "pie_csimex1.php#6");
$alts = array("val=%d", "val=%d", "val=%d", "val=%d", "val=%d", "val=%d");
$p1->SetCSIMTargets($targ, $alts);
$graph->Add($p1);
// Send back the HTML page which will call this script again
// to retrieve the image.
$graph->StrokeCSIM('pie_csimex1.php');
?>


开发者ID:tavo1981,项目名称:phpbar,代码行数:24,代码来源:pie_csimex1.php

示例2: formatPercentage

    $legends[] = $currentLabel . ' - ' . $amounts[$currentKey]->getFormatted();
}
$targets = array();
foreach ($labels as $currentId => $currentLabel) {
    if ($currentId != 'none' && $currentId != 'other') {
        $targets[] = 'javascript:reachThroughCategory(\'' . substr($currentId, 1) . '\');';
    } else {
        $targets[] = '';
    }
}
$pie = new PiePlot3D($data);
$pie->SetLegends($legends);
$pie->SetCSIMTargets($targets, $dataNames);
$pie->value->SetFont(FF_VERA);
$pie->value->SetFormatCallback('formatPercentage');
$pie->SetCenter(0.33, 0.5);
//$pie->SetSliceColors($chartColors);
$graph->Add($pie);
$graph->legend->SetFont(FF_VERA);
$graph->legend->SetPos(0.03, 0.05);
$graph->SetMargin(10, 10, 10, 10);
$graph->SetShadow();
$graph->SetAntiAliasing();
$graph->StrokeCSIM(basename(__FILE__));
require_once BADGER_ROOT . "/includes/fileFooter.php";
function formatPercentage($val)
{
    global $us;
    $str = sprintf('%1.2f %%', $val);
    return str_replace('.', $us->getProperty('badgerDecimalSeparator'), $str);
}
开发者ID:BackupTheBerlios,项目名称:badger-svn,代码行数:31,代码来源:category.php

示例3: array

// The label array values may have printf() formatting in them. The argument to the
// form,at string will be the value of the slice (either the percetage or absolute
// depending on what was specified in the SetLabelType() above.
$lbl = array("adam\n%.1f%%", "bertil\n%.1f%%", "johan\n%.1f%%", "peter\n%.1f%%", "daniel\n%.1f%%", "erik\n%.1f%%");
$p1->SetLabels($lbl);
// Uncomment this line to remove the borders around the slices
// $p1->ShowBorder(false);
// Add drop shadow to slices
$p1->SetShadow();
// Explode all slices 15 pixels
$p1->ExplodeAll(15);
// Setup the CSIM targets
$targ = array("piec_csimex1.php#1", "piec_csimex1.php#2", "piec_csimex1.php#3", "piec_csimex1.php#4", "piec_csimex1.php#5", "piec_csimex1.php#6");
$alts = array("val=%d", "val=%d", "val=%d", "val=%d", "val=%d", "val=%d");
$p1->SetCSIMTargets($targ, $alts);
$p1->SetMidCSIM("piec_csimex1.php#7", "Center");
// Setup a small help text in the image
$txt = new Text("Note: This is an example of image map. Hold\nyour mouse over the slices to see the values.\nThe URL just points back to this page");
$txt->SetFont(FF_FONT1, FS_BOLD);
$txt->SetPos(0.5, 0.97, 'center', 'bottom');
$txt->SetBox('yellow', 'black');
$txt->SetShadow();
$graph->AddText($txt);
// Add plot to pie graph
$graph->Add($p1);
// .. and send the image on it's marry way to the browser
$graph->StrokeCSIM();
?>


开发者ID:hcvcastro,项目名称:pxp,代码行数:28,代码来源:piec_csimex1.php

示例4: pie_single_mailbox_user

function pie_single_mailbox_user()
{
    $tpl = new Templates();
    $users = new usersMenus();
    $uid = $_SESSION["uid"];
    if ($users->cyrus_imapd_installed == 0) {
        return null;
    }
    $ldap = new clladp();
    $hash = $ldap->UserDatas($_SESSION["uid"]);
    if ($hash["MailboxActive"] != 'TRUE') {
        return null;
    }
    $cyrus = new cyrus();
    $res = $cyrus->get_quota_array($uid);
    $size = $cyrus->MailboxInfosSize($uid);
    $free = $cyrus->USER_STORAGE_LIMIT - $cyrus->USER_STORAGE_USAGE;
    if (!$cyrus->MailBoxExists($uid)) {
        return null;
    }
    $USER_STORAGE_USAGE = $cyrus->USER_STORAGE_USAGE;
    $USER_STORAGE_LIMIT = $cyrus->USER_STORAGE_LIMIT;
    $FREE = $free;
    writelogs("USER_STORAGE_USAGE={$USER_STORAGE_USAGE}", __FUNCTION__, __FILE__);
    writelogs("STORAGE_LIMIT={$USER_STORAGE_LIMIT}", __FUNCTION__, __FILE__);
    if ($USER_STORAGE_LIMIT == null) {
        $USER_STORAGE_LIMIT = 1000000;
        $USER_STORAGE_USAGE = 0;
        $FREE = $USER_STORAGE_LIMIT;
    }
    $USER_STORAGE_RESTANT = $USER_STORAGE_LIMIT - $USER_STORAGE_USAGE;
    if ($USER_STORAGE_RESTANT > 1) {
        $reste = round($USER_STORAGE_RESTANT / 1024);
        $data = array($USER_STORAGE_USAGE, $USER_STORAGE_RESTANT);
    } else {
        $data = array($USER_STORAGE_USAGE);
    }
    $title = $tpl->_ENGINE_parse_body("{your mailbox usage} ({$reste} mb free)");
    writelogs("USER_STORAGE_USAGE={$USER_STORAGE_USAGE} - USER_STORAGE_LIMIT={$USER_STORAGE_LIMIT} FREE={$FREE}", __FUNCTION__, __FILE__);
    $date = date('Y-m-d');
    $textes = array();
    $donnees = array();
    $zlabel = array();
    $date = date('Y-m-d');
    $donnees[] = $FREE;
    $textes[] = "{$FREE} Free";
    $donnees[] = $USER_STORAGE_USAGE;
    $textes[] = "{$USER_STORAGE_USAGE} used";
    $data = $donnees;
    $graph = new PieGraph(370, 350, 'auto');
    //$graph->SetShadow();
    $graph->title->Set($title);
    $graph->title->SetFont(FF_FONT1, FS_BOLD);
    $p1 = new PiePlot3D($data);
    $p1->SetLabels($textes, 1);
    $p1->SetEdge('black', 0);
    $p1->SetAngle(55);
    $p1->SetLabelMargin(2);
    $p1->SetCenter(0.4, 0.5);
    $p1->ExplodeAll(10);
    $graph->Add($p1);
    $graph->SetFrame(false);
    $graph->StrokeCSIM();
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:64,代码来源:users.charts.php


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