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


PHP PiePlot::SetStartAngle方法代码示例

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


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

示例1: PieGraph

    }
}
$longest_size++;
for ($i = 0; $i < $category_count; $i++) {
    #echo $data_count_arr[$i];
    $percentage = number_format($data_count_arr[$i] / $total * 100, 1);
    #echo $percentage;
    $percentage_str = str_pad($percentage, 5, ' ', STR_PAD_LEFT);
    $data_category_arr[$i] = str_pad($data_category_arr[$i], $longest_size);
    $data_category_arr[$i] = $data_category_arr[$i] . $percentage_str;
    if ($percentage < 1) {
        $data_count_arr[$i] = 0;
    }
}
$proj_name = project_get_field($t_project_id, 'name');
# Setup Graph
# ---
$graph = new PieGraph(800, 600);
$graph->SetShadow();
# Set A title for the plot
$graph->title->Set("Category Distribution Graph: {$proj_name}");
$graph->title->SetFont(FF_FONT2, FS_BOLD);
# Create graph
$p1 = new PiePlot($data_count_arr);
$p1->SetLegends($data_category_arr);
$p1->SetSize(260);
$p1->SetCenter(0.35);
$p1->SetSliceColors($g_color_arr);
$p1->SetStartAngle(-90);
$graph->Add($p1);
$graph->Stroke();
开发者ID:jin255ff,项目名称:company_website,代码行数:31,代码来源:graph_by_category.php

示例2: array

<?php

// Include needed classes
require_once 'jpgraph/jpgraph.php';
require_once 'jpgraph/jpgraph_pie.php';
// Our data
$data = array(78, 22);
// Create the Pie Graph
$graph = new PieGraph(350, 300, 'auto');
$graph->SetShadow();
// Set A title for the plot + disable the border
$graph->title->Set("Percentage of chart which resembles Pac-man");
$graph->SetFrame(false);
// Create the pieplot
$pieplot = new PiePlot($data);
$pieplot->SetCenter(0.5, 0.5);
$pieplot->SetStartAngle(39);
$pieplot->SetLegends(array('Pac-man', 'Not Pac-Man'));
// Add the pieplot to the graph
$graph->Add($pieplot);
// JpGraph Bug: you must first add the pieplot before you can set the colors (?!)
$pieplot->SetSliceColors(array('#FFFF00', '#FF0000'));
// Style the Legend
$graph->legend->SetFrameWeight(0);
$graph->legend->Pos(0.5, 0.9, 'center', 'top');
$graph->legend->SetFillColor('white');
$graph->legend->SetColumns(2);
// Display the graph
$graph->Stroke();
开发者ID:robinstaes,项目名称:ws2-sws-course-materials,代码行数:29,代码来源:index.php

示例3: baw_render_jpgraph_img

function baw_render_jpgraph_img()
{
    include_once "../config.php";
    if (isset($_GET['type'])) {
        $type = $_GET['type'];
    } else {
        return;
    }
    $d = $_GET['d'];
    $f = $_GET['f'];
    $count = count($d);
    $dir = $BAW_CONF['jpgraph_path'] . '/jpgraph.php';
    include_once $dir;
    switch ($type) {
        case 'bar':
            include_once $BAW_CONF['jpgraph_path'] . '/jpgraph_bar.php';
            break;
        case 'pie':
            include_once $BAW_CONF['jpgraph_path'] . "/jpgraph_pie.php";
            $size = 0.17;
            $graph = new PieGraph(600, 250, "auto");
            for ($i = 0; $i < 1; $i++) {
                $p1 = new PiePlot($d[$i]);
                if ($i == 0) {
                    $p1->SetLegends($d[0]);
                }
                $p1->title->Set($f[1]);
                $p1->SetSize($size);
                $vert = 0.15 + ($size + 0.1) * $i;
                $p1->SetCenter($vert, 0.3);
                $p1->SetStartAngle(0);
                $p1->SetTheme("sand");
                $graph->Add($p1);
            }
            $graph->Stroke();
            break;
        case 'line':
            include_once $BAW_CONF['jpgraph_path'] . "/jpgraph_line.php";
            break;
    }
    return $out;
}
开发者ID:ibevamp,项目名称:t30,代码行数:42,代码来源:render_jpgraph.inc.php

示例4: PiePlot

 $graph->title->Set($m);
 $graph->title->SetFont(FF_VERDANA, FS_BOLD, 12);
 $graph->title->SetColor('black');
 $graph->title->SetMargin(10);
 $graph->subtitle->SetFont(FF_ARIAL, FS_BOLD, 10);
 $graph->subtitle->Set('Importe Total $ ' . $importe);
 // Create pie plot
 $p1 = new PiePlot($datay);
 $p1->SetSize(0.3);
 $p1->SetCenter(0.5, 0.32);
 $p1->ExplodeAll(5);
 $p1->SetShadow();
 $p1->SetSliceColors($color);
 $p1->SetGuideLines(true, false);
 $p1->SetGuideLinesAdjust(1.1);
 $p1->SetStartAngle(200);
 // Setup the labels to be displayed
 $p1->SetLabels($name);
 $p1->SetLegends($datax);
 $graph->legend->SetPos(0.39, 0.97, 'center', 'bottom');
 $graph->legend->SetColumns(2);
 // This method adjust the position of the labels. This is given as fractions
 // of the radius of the Pie. A value < 1 will put the center of the label
 // inside the Pie and a value >= 1 will pout the center of the label outside the
 // Pie. By default the label is positioned at 0.5, in the middle of each slice.
 $p1->SetLabelPos(0.55);
 // Setup the label formats and what value we want to be shown (The absolute)
 // or the percentage.
 $p1->SetLabelType(PIE_VALUE_PER);
 $p1->value->Show();
 $p1->value->SetFont(FF_ARIAL, FS_NORMAL, 9);
开发者ID:linuxman,项目名称:uycodeka,代码行数:31,代码来源:graficotorta.php


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