本文整理汇总了PHP中ezcGraphPieChart类的典型用法代码示例。如果您正苦于以下问题:PHP ezcGraphPieChart类的具体用法?PHP ezcGraphPieChart怎么用?PHP ezcGraphPieChart使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ezcGraphPieChart类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: sourceGraph
private function sourceGraph()
{
$q = ezcDbInstance::get()->createSelectQuery();
$q->select('source, count(source)')->from('message')->groupBy('source');
$s = $q->prepare();
$s->execute();
$chart = new ezcGraphPieChart();
$chart->title = 'Sources';
$chart->legend = false;
$chart->palette = new ezcGraphPaletteEz();
$chart->data['browsers'] = new ezcGraphDatabaseDataSet($s);
$chart->render(300, 200, '/tmp/graph.png');
return file_get_contents('/tmp/graph.png');
}
开发者ID:jeanvoye,项目名称:utb,代码行数:14,代码来源:graph.php
示例2: testRenderPieChartWithGleamAndShadow
public function testRenderPieChartWithGleamAndShadow()
{
$filename = $this->tempDir . __FUNCTION__ . '.svg';
$chart = new ezcGraphPieChart();
$chart->data['sample'] = new ezcGraphArrayDataSet(array('Mozilla' => 4375, 'IE' => 345, 'Opera' => 1204, 'wget' => 231, 'Safari' => 987));
$chart->data['sample']->highlight['Opera'] = true;
$chart->renderer->options->legendSymbolGleam = 0.5;
$chart->renderer->options->pieChartShadowSize = 5;
$chart->renderer->options->pieChartGleamBorder = 3;
$chart->renderer->options->pieChartGleam = 0.5;
$chart->driver = new ezcGraphSvgDriver();
$chart->render(500, 200, $filename);
$this->compare($filename, $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.svg');
}
开发者ID:broschb,项目名称:cyclebrain,代码行数:14,代码来源:renderer_2d_test.php
示例3: ezcGraphPieChart
<?php
require_once 'tutorial_autoload.php';
$graph = new ezcGraphPieChart();
$graph->title = 'Elections 2005 Germany';
$graph->data['2005'] = new ezcGraphArrayDataSet(array('CDU' => 35.2, 'SPD' => 34.2, 'FDP' => 9.800000000000001, 'Die Gruenen' => 8.1, 'PDS' => 8.699999999999999, 'NDP' => 1.6, 'REP' => 0.6));
$graph->options->label = '%3$.1f%%';
$graph->options->sum = 100;
$graph->options->percentThreshold = 0.02;
$graph->options->summarizeCaption = 'Others';
$graph->render(400, 150, 'tutorial_pie_options.svg');
开发者ID:madscientist159,项目名称:Graph,代码行数:11,代码来源:tutorial_pie_options.php
示例4: __autoload
<?php
require 'Base/src/base.php';
function __autoload($className)
{
ezcBase::autoload($className);
}
// Require custom palette
require dirname(__FILE__) . '/ez_green.php';
// Create the graph
$graph = new ezcGraphPieChart();
$graph->palette = new ezcGraphPaletteEzGreen();
$graph->legend = false;
// Add the data and hilight norwegian data set
$graph->data['week'] = new ezcGraphArrayDataSet(array('Lukasz Serwatka' => 1805, 'Paul Forsyth' => 1491, 'Paul Borgermans' => 1316, 'Kristof Coomans' => 956, 'Alex Jones' => 942, 'Bard Farstad' => 941, 'Tony Wood' => 900));
// Set graph title
$graph->title = 'Alltime 10 most active users on forum';
// Use 3d renderer, and beautify it
$graph->renderer = new ezcGraphRenderer3d();
$graph->renderer->options->pieChartShadowSize = 12;
$graph->renderer->options->pieChartGleam = 0.5;
$graph->renderer->options->dataBorder = false;
$graph->renderer->options->pieChartHeight = 16;
$graph->renderer->options->legendSymbolGleam = 0.5;
$graph->renderer->options->pieChartOffset = 100;
$graph->driver = new ezcGraphSvgDriver();
// Output the graph with std SVG driver
$graph->render(500, 200, 'forum_year.svg');
开发者ID:madscientist159,项目名称:Graph,代码行数:28,代码来源:forum_year.php
示例5: ezcGraphPieChart
<?php
require_once 'tutorial_autoload.php';
$graph = new ezcGraphPieChart();
$graph->palette = new ezcGraphPaletteEzGreen();
$graph->title = 'Access statistics';
$graph->driver = new ezcGraphGdDriver();
$graph->options->font = 'tutorial_font.ttf';
$graph->data['Access statistics'] = new ezcGraphArrayDataSet(array('Mozilla' => 19113, 'Explorer' => 10917, 'Opera' => 1464, 'Safari' => 652, 'Konqueror' => 474));
$graph->data['Access statistics']->url = 'http://example.org/';
$graph->data['Access statistics']->url['Mozilla'] = 'http://example.org/mozilla';
$graph->render(400, 200, 'tutorial_reference_gd.png');
?>
<html>
<head><title>Image map example</title></head>
<body>
<?php
echo ezcGraphTools::createImageMap($graph, 'GraphPieChartMap');
?>
<img
src="tutorial_reference_gd.png"
width="400" height="200"
usemap="#GraphPieChartMap" />
</body>
</html>
开发者ID:madscientist159,项目名称:Graph,代码行数:25,代码来源:tutorial_reference_gd.php
示例6: printPieChart
/**
* Creates and prints the pie chart in the statistic
*
* @param String $type
*
* @static
*
*/
static function printPieChart($type = 'tech')
{
global $CFG_GLPI;
// Definition of Chart Labels
$label = array('tech' => __('Rating by the user', 'helpdeskrating'), 'user' => __('Rating by the technician', 'helpdeskrating'));
$uid = PluginHelpdeskratingStatistic::getUserID();
if ($uid) {
// Get Graph Data
$data = PluginHelpdeskratingStatistic::getSpreadingData($type);
if ($data[__('in progress', 'helpdeskrating')] == 0 && $data[__('closed', 'helpdeskrating')] == 0 && $data[__('rated', 'helpdeskrating')] == 0) {
echo "<h1>{$label[$type]}</h1>";
echo __('no data available', 'helpdeskrating');
} else {
// Create Graph
$graph = new ezcGraphPieChart();
$graph->title = $label[$type];
// Set Graph Data
$graph->data['data'] = new ezcGraphArrayDataSet($data);
// Graph Legend
$graph->legend->position = ezcGraph::BOTTOM;
$graph->data['data']->color[__('in progress', 'helpdeskrating')] = '#55575388';
$graph->data['data']->highlight[__('in progress', 'helpdeskrating')] = true;
$graph->data['data']->color[__('closed', 'helpdeskrating')] = '#F5900080';
$graph->data['data']->color[__('rated', 'helpdeskrating')] = '#4E9A0680';
// Graph Output
$filename = $uid . '_' . mt_rand() . '.svg';
$graph->render(400, 300, GLPI_GRAPH_DIR . '/' . $filename);
echo "<object data='" . $CFG_GLPI['root_doc'] . "/front/graph.send.php?file={$filename}'\n type='image/svg+xml' width='400' height='300'>\n <param name='src' value='" . $CFG_GLPI['root_doc'] . "/front/graph.send.php?file={$filename}'>\n You need a browser capeable of SVG to display this image.\n </object> ";
}
}
}
开发者ID:geldarr,项目名称:hack-space,代码行数:39,代码来源:statistic.class.php
示例7: graph_pie
function graph_pie($p_metrics, $p_title = '', $p_graph_width = 500, $p_graph_height = 350, $p_center = 0.4, $p_poshorizontal = 0.1, $p_posvertical = 0.09)
{
$t_graph_font = graph_get_font();
error_check(is_array($p_metrics) ? array_sum($p_metrics) : 0, $p_title);
if (plugin_config_get('eczlibrary') == ON) {
$graph = new ezcGraphPieChart();
$graph->title = $p_title;
$graph->background->color = '#FFFFFF';
$graph->options->font = $t_graph_font;
$graph->options->font->maxFontSize = 12;
$graph->legend = false;
$graph->data[0] = new ezcGraphArrayDataSet($p_metrics);
$graph->data[0]->color = '#FFFF00';
$graph->renderer = new ezcGraphRenderer3d();
$graph->renderer->options->dataBorder = false;
$graph->renderer->options->pieChartShadowSize = 10;
$graph->renderer->options->pieChartGleam = 0.5;
$graph->renderer->options->pieChartHeight = 16;
$graph->renderer->options->legendSymbolGleam = 0.5;
$graph->driver = new ezcGraphGdDriver();
//$graph->driver->options->supersampling = 1;
$graph->driver->options->jpegQuality = 100;
$graph->driver->options->imageFormat = IMG_JPEG;
$graph->renderer->options->syncAxisFonts = false;
$graph->renderToOutput($p_graph_width, $p_graph_height);
} else {
$graph = new PieGraph($p_graph_width, $p_graph_height);
$graph->img->SetMargin(40, 40, 40, 100);
$graph->title->Set($p_title);
$graph->title->SetFont($t_graph_font, FS_BOLD);
$graph->SetMarginColor('white');
$graph->SetFrame(false);
$graph->legend->Pos($p_poshorizontal, $p_posvertical);
$graph->legend->SetFont($t_graph_font);
$p1 = new PiePlot3d(array_values($p_metrics));
// should be reversed?
$p1->SetTheme('earth');
# $p1->SetTheme("sand");
$p1->SetCenter($p_center);
$p1->SetAngle(60);
$p1->SetLegends(array_keys($p_metrics));
# Label format
$p1->value->SetFormat('%2.0f');
$p1->value->Show();
$p1->value->SetFont($t_graph_font);
$graph->Add($p1);
if (helper_show_query_count()) {
$graph->subtitle->Set(db_count_queries() . ' queries (' . db_time_queries() . 'sec)');
$graph->subtitle->SetFont($t_graph_font, FS_NORMAL, 8);
}
$graph->Stroke();
}
}
开发者ID:kaos,项目名称:mantisbt,代码行数:53,代码来源:graph_api.php
示例8: testSvgWithDifferentLocales
public function testSvgWithDifferentLocales()
{
$this->setLocale(LC_NUMERIC, 'de_DE', 'de_DE.UTF-8', 'de_DE.UTF8', 'deu_deu', 'de', 'ge', 'deutsch', 'de_DE@euro');
$filename = $this->tempDir . __FUNCTION__ . '.svg';
$chart = new ezcGraphPieChart();
$chart->palette = new ezcGraphPaletteEz();
$chart->options->font = $this->basePath . 'font.svg';
$chart->data['sample'] = new ezcGraphArrayDataSet(array('Mozilla' => 4375, 'IE' => 345, 'Opera' => 1204, 'wget' => 231, 'Safari' => 987));
$chart->data['sample']->highlight['Safari'] = true;
$chart->renderer = new ezcGraphRenderer3d();
$chart->renderer->options->pieChartShadowSize = 10;
$chart->renderer->options->pieChartGleam = 0.5;
$chart->renderer->options->dataBorder = false;
$chart->renderer->options->pieChartHeight = 16;
$chart->renderer->options->legendSymbolGleam = 0.5;
$chart->render(500, 200, $filename);
$this->compare($filename, $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.svg');
}
开发者ID:xyzz,项目名称:CrashFix,代码行数:18,代码来源:driver_svg_svg_font_test.php
示例9: testRenderLabeledFlashPieChart
public function testRenderLabeledFlashPieChart()
{
$filename = $this->tempDir . __FUNCTION__ . '.swf';
$chart = new ezcGraphPieChart();
$chart->options->font->path = dirname(__FILE__) . '/data/fdb_font.fdb';
$chart->palette = new ezcGraphPaletteEz();
$chart->data['sample'] = new ezcGraphArrayDataSet(array('Mozilla' => 4375, 'IE' => 345, 'Opera' => 1204, 'wget' => 231, 'Safari' => 987));
$chart->data['sample']->highlight['Safari'] = true;
$chart->renderer = new ezcGraphRenderer3d();
$chart->renderer->options->pieChartShadowSize = 10;
$chart->renderer->options->pieChartGleam = 0.5;
$chart->renderer->options->dataBorder = false;
$chart->renderer->options->pieChartHeight = 16;
$chart->renderer->options->legendSymbolGleam = 0.5;
$chart->driver = new ezcGraphFlashDriver();
$chart->render(500, 200, $filename);
$this->swfCompare($filename, $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.swf');
}
开发者ID:madscientist159,项目名称:Graph,代码行数:18,代码来源:driver_flash_test.php
示例10: testPieChartWithoutData
public function testPieChartWithoutData()
{
try {
$pieChart = new ezcGraphPieChart();
$pieChart->render(400, 200);
} catch (ezcGraphNoDataException $e) {
return true;
}
$this->fail('Expected ezcGraphNoDataException.');
}
开发者ID:mediasadc,项目名称:alba,代码行数:10,代码来源:chart_test.php
示例11: testBottomLegend
public function testBottomLegend()
{
$filename = $this->tempDir . __FUNCTION__ . '.svg';
$chart = new ezcGraphPieChart();
$chart->data['sample'] = new ezcGraphArrayDataSet(array('Mozilla' => 4375, 'IE' => 345, 'Opera' => 1204, 'wget' => 231, 'Safari' => 987));
$chart->legend->position = ezcGraph::BOTTOM;
$chart->legend->padding = 2;
$chart->render(500, 200, $filename);
$this->compare($filename, $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.svg');
}
开发者ID:mediasadc,项目名称:alba,代码行数:10,代码来源:legend_test.php
示例12: ezcGraphPieChart
<?php
require_once 'tutorial_autoload.php';
$graph = new ezcGraphPieChart();
$graph->title = 'Access statistics';
$graph->data['Access statistics'] = new ezcGraphArrayDataSet(array('Mozilla' => 19113, 'Explorer' => 10917, 'Opera' => 1464, 'Safari' => 652, 'Konqueror' => 474));
$graph->data['Access statistics']->highlight['Opera'] = true;
$graph->render(400, 150, 'tutorial_simple_pie.svg');
开发者ID:madscientist159,项目名称:Graph,代码行数:8,代码来源:tutorial_simple_pie.php
示例13: ezcGraphPieChart
<?php
require_once 'tutorial_autoload.php';
$graph = new ezcGraphPieChart();
$graph->palette = new ezcGraphPaletteEzBlue();
$graph->title = 'Access statistics';
$graph->options->font->name = 'serif';
$graph->title->background = '#EEEEEC';
$graph->title->font->name = 'sans-serif';
$graph->options->font->maxFontSize = 8;
$graph->data['Access statistics'] = new ezcGraphArrayDataSet(array('Mozilla' => 19113, 'Explorer' => 10917, 'Opera' => 1464, 'Safari' => 652, 'Konqueror' => 474));
$graph->render(400, 150, 'tutorial_chart_title.svg');
开发者ID:madscientist159,项目名称:Graph,代码行数:12,代码来源:tutorial_chart_title.php
示例14: ezcGraphPieChart
<?php
/* -*- mode: php; c-basic-offset: 4; indent-tabs-mode: nil; -*-
* vim:expandtab:shiftwidth=4:tabstop=4:
*/
$graph = new ezcGraphPieChart();
$graph->palette = new ezcGraphPaletteEzBlue();
$graph->legend = false;
$graph->data['File number per ' . $index] = new ezcGraphArrayDataSet($count);
$graph->data['File number per ' . $index]->highlight['Others'] = true;
$graph->renderer = new ezcGraphRenderer3d();
$graph->renderer->options->moveOut = 0.2;
$graph->renderer->options->pieChartOffset = 63;
$graph->renderer->options->pieChartGleam = 0.3;
$graph->renderer->options->pieChartGleamColor = '#FFFFFF';
$graph->renderer->options->pieChartGleamBorder = 2;
$graph->renderer->options->pieChartShadowSize = 5;
$graph->renderer->options->pieChartShadowColor = '#BABDB6';
$graph->renderer->options->pieChartHeight = 5;
$graph->renderer->options->pieChartRotation = 0.8;
$graph->driver = new ezcGraphGdDriver();
$graph->options->font = 'app/img/arial.ttf';
$graph->driver->options->imageFormat = IMG_PNG;
$graph->render(532, 195, 'app/img/graph/countPieGraph.png');
echo '<h2>File number per ' . $index . '</h2>';
?>
<img src="app/img/graph/countPieGraph.png"/>
<table class="simple">
<thead>
<tr>
开发者ID:rootfs,项目名称:robinhood,代码行数:31,代码来源:count.php
示例15: ezcGraphPieChart
<?php
require_once 'tutorial_autoload.php';
$graph = new ezcGraphPieChart();
$graph->palette = new ezcGraphPaletteEzRed();
$graph->title = 'Access statistics';
$graph->options->label = '%2$d (%3$.1f%%)';
$graph->data['Access statistics'] = new ezcGraphArrayDataSet(array('Mozilla' => 19113, 'Explorer' => 10917, 'Opera' => 1464, 'Safari' => 652, 'Konqueror' => 474));
$graph->data['Access statistics']->highlight['Explorer'] = true;
$graph->renderer = new ezcGraphRenderer3d();
$graph->renderer->options->moveOut = 0.2;
$graph->renderer->options->pieChartOffset = 63;
$graph->renderer->options->pieChartGleam = 0.3;
$graph->renderer->options->pieChartGleamColor = '#FFFFFF';
$graph->renderer->options->pieChartShadowSize = 5;
$graph->renderer->options->pieChartShadowColor = '#000000';
$graph->renderer->options->legendSymbolGleam = 0.5;
$graph->renderer->options->legendSymbolGleamSize = 0.9;
$graph->renderer->options->legendSymbolGleamColor = '#FFFFFF';
$graph->renderer->options->pieChartSymbolColor = '#55575388';
$graph->renderer->options->pieChartHeight = 5;
$graph->renderer->options->pieChartRotation = 0.8;
$graph->render(400, 150, 'tutorial_pie_chart_3d.svg');
开发者ID:madscientist159,项目名称:Graph,代码行数:23,代码来源:tutorial_pie_chart_3d.php
示例16: ezcGraphPieChart
<?php
require_once 'tutorial_autoload.php';
$graph = new ezcGraphPieChart();
$graph->palette = new ezcGraphPaletteEz();
$graph->title = 'Access statistics';
$graph->data['Access statistics'] = new ezcGraphArrayDataSet(array('Mozilla' => 19113, 'Explorer' => 10917, 'Opera' => 1464, 'Safari' => 652, 'Konqueror' => 474));
$graph->data['Access statistics']->url = 'http://example.org/';
$graph->data['Access statistics']->url['Mozilla'] = 'http://example.org/mozilla';
$graph->render(400, 200, 'tutorial_reference_svg.svg');
$graph->driver->options->linkCursor = 'crosshair';
ezcGraphTools::linkSvgElements($graph);
开发者ID:madscientist159,项目名称:Graph,代码行数:12,代码来源:tutorial_reference_svg.php
示例17: ezcGraphPieChart
<?php
require_once 'tutorial_insert_data.php';
// Receive data from database
$db = ezcDbInstance::get();
$query = $db->createSelectQuery();
$query->select('browser', 'hits')->from('browser_hits');
$statement = $query->prepare();
$statement->execute();
// Create chart from data
$chart = new ezcGraphPieChart();
$chart->title = 'Browser statistics';
$chart->data['browsers'] = new ezcGraphDatabaseDataSet($statement);
$chart->render(400, 200, 'tutorial_simple.svg');
开发者ID:andikoller,项目名称:FHC-3.0-FHBGLD,代码行数:14,代码来源:tutorial_simple.php
示例18: testPieChartSvgLinkingCustomCursor
public function testPieChartSvgLinkingCustomCursor()
{
$filename = $this->tempDir . __FUNCTION__ . '.svg';
$chart = new ezcGraphPieChart();
$chart->data['sample'] = new ezcGraphArrayDataSet(array('Mozilla' => 4375, 'IE' => 345, 'Opera' => 1204, 'wget' => 231, 'Safari' => 987));
$chart->data['sample']->url = 'http://example.org/browsers';
$chart->data['sample']->url['Mozilla'] = 'http://example.org/browsers/mozilla';
$chart->data['sample']->highlight['Opera'] = true;
$chart->driver->options->linkCursor = 'crosshair';
$chart->render(500, 200, $filename);
ezcGraphTools::linkSvgElements($chart);
$this->compare($filename, $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.svg');
}
开发者ID:madscientist159,项目名称:Graph,代码行数:13,代码来源:tools_test.php
示例19: ezcGraphPieChart
<?php
require_once 'tutorial_autoload.php';
$graph = new ezcGraphPieChart();
$graph->title = 'Access statistics';
$graph->legend = false;
$graph->driver = new ezcGraphFlashDriver();
$graph->options->font = 'tutorial_font.fdb';
$graph->driver->options->compression = 7;
$graph->data['Access statistics'] = new ezcGraphArrayDataSet(array('Mozilla' => 19113, 'Explorer' => 10917, 'Opera' => 1464, 'Safari' => 652, 'Konqueror' => 474));
$graph->renderer = new ezcGraphRenderer3d();
$graph->renderer->options->pieChartShadowSize = 10;
$graph->renderer->options->pieChartGleam = 0.5;
$graph->renderer->options->dataBorder = false;
$graph->renderer->options->pieChartHeight = 16;
$graph->renderer->options->legendSymbolGleam = 0.5;
$graph->render(400, 200, 'tutorial_driver_flash.swf');
开发者ID:madscientist159,项目名称:Graph,代码行数:17,代码来源:tutorial_driver_flash.php
示例20: testRender3dPieChartWithOneDataPoint
public function testRender3dPieChartWithOneDataPoint()
{
$filename = $this->tempDir . __FUNCTION__ . '.svg';
$chart = new ezcGraphPieChart();
$chart->data['Skien'] = new ezcGraphArrayDataSet(array('Norwegian' => 10));
$chart->renderer = new ezcGraphRenderer3d();
$chart->renderer->options->dataBorder = false;
$chart->render(500, 300, $filename);
$this->compare($filename, $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.svg');
}
开发者ID:xyzz,项目名称:CrashFix,代码行数:10,代码来源:pie_test.php
注:本文中的ezcGraphPieChart类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论