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


PHP pData::setSerieDrawable方法代码示例

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


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

示例1: pData

/* CAT:Bar Chart */
/* pChart library inclusions */
include "../class/pData.class.php";
include "../class/pDraw.class.php";
include "../class/pImage.class.php";
/* Create and populate the pData object */
$MyData = new pData();
$MyData->loadPalette("../palettes/blind.color", TRUE);
$MyData->addPoints(array(150, 220, 300, 250, 420, 200, 300, 200, 110), "Server A");
$MyData->addPoints(array("January", "February", "March", "April", "May", "Juin", "July", "August", "September"), "Months");
$MyData->setSerieDescription("Months", "Month");
$MyData->setAbscissa("Months");
/* Create the floating 0 data serie */
$MyData->addPoints(array(60, 80, 20, 40, 40, 50, 90, 30, 100), "Floating 0");
$MyData->setSerieDrawable("Floating 0", FALSE);
/* Create the pChart object */
$myPicture = new pImage(700, 230, $MyData);
/* Set the default font */
$myPicture->setFontProperties(array("FontName" => "../fonts/Forgotte.ttf", "FontSize" => 10, "R" => 110, "G" => 110, "B" => 110));
/* Write the title */
$myPicture->drawText(10, 13, "Net Income 2k8");
/* Set the graphical area  */
$myPicture->setGraphArea(50, 30, 680, 180);
/* Draw the scale  */
$AxisBoundaries = array(0 => array("Min" => 0, "Max" => 500));
$myPicture->drawScale(array("InnerTickWidth" => 0, "OuterTickWidth" => 0, "Mode" => SCALE_MODE_MANUAL, "ManualScale" => $AxisBoundaries, "LabelRotation" => 45, "DrawXLines" => FALSE, "GridR" => 0, "GridG" => 0, "GridB" => 0, "GridTicks" => 0, "GridAlpha" => 30, "AxisAlpha" => 0));
/* Turn on shadow computing */
$myPicture->setShadow(TRUE, array("X" => 1, "Y" => 1, "R" => 0, "G" => 0, "B" => 0, "Alpha" => 10));
/* Draw the chart */
$settings = array("Floating0Serie" => "Floating 0", "Surrounding" => 10);
开发者ID:OndroNR,项目名称:bitcoin-hal10k,代码行数:30,代码来源:example.drawBarChart.span.php

示例2: buildCostPieChartData

 protected function buildCostPieChartData()
 {
     $data = parent::buildCostPieChartData();
     if (!$data) {
         return $data;
     }
     $this->setOption('title', $data['title']);
     $myData = new pData();
     $y_series = $data['y']['series'];
     // building chart data for each vehicle
     foreach ($y_series as $key => $y) {
         $values = $this->filterNulls($y['values']);
         if (!$values) {
             continue;
         }
         $myData->addPoints($values, $y['id']);
         $myData->setSerieDescription($y['id'], $y['label']);
         $myData->setSerieDrawable($y['id'], false);
         // series will be activated in plotPieChart
     }
     $x = $data['x'];
     // adding labels
     $myData->addPoints($x['values'], $x['id']);
     $myData->setAbscissa($x['id']);
     return $myData;
 }
开发者ID:rbolliger,项目名称:otokou,代码行数:26,代码来源:ChartBuilderPChart.class.php

示例3: pImage

$MyData->setAbscissaName("Time (years)");
/* Create the pChart object */
$myPicture = new pImage(700, 230, $MyData);
/* Turn of Antialiasing */
$myPicture->Antialias = FALSE;
/* Draw the background and the border  */
$myPicture->drawFilledRectangle(0, 0, 699, 229, array("R" => 200, "G" => 200, "B" => 200));
$myPicture->drawGradientArea(0, 0, 700, 230, DIRECTION_VERTICAL, array("StartR" => 220, "StartG" => 220, "StartB" => 220, "EndR" => 100, "EndG" => 100, "EndB" => 100, "Alpha" => 30));
$myPicture->drawRectangle(0, 0, 699, 229, array("R" => 0, "G" => 0, "B" => 0));
/* Write the chart title */
$myPicture->setFontProperties(array("FontName" => "../fonts/Forgotte.ttf", "FontSize" => 11));
$myPicture->drawText(150, 35, "Size by time generations", array("FontSize" => 20, "Align" => TEXT_ALIGN_BOTTOMMIDDLE));
/* Set the default font */
$myPicture->setFontProperties(array("FontName" => "../fonts/pf_arma_five.ttf", "FontSize" => 6));
/* Define the chart area */
$myPicture->setGraphArea(40, 40, 680, 200);
/* Draw the scale */
$scaleSettings = array("LabelSkip" => 4, "XMargin" => 10, "YMargin" => 10, "Floating" => TRUE, "GridAlpha" => 30, "GridR" => 140, "GridG" => 140, "GridB" => 140, "DrawSubTicks" => TRUE);
$myPicture->drawScale($scaleSettings);
/* Turn on Antialiasing */
$myPicture->Antialias = TRUE;
/* Draw the line chart */
$myPicture->drawZoneChart("Bounds 1", "Bounds 2", array("LineAlpha" => 100, "AreaR" => 230, "AreaG" => 230, "AreaB" => 230, "AreaAlpha" => 20, "LineTicks" => 3));
$MyData->setSerieDrawable(array("Bounds 1", "Bounds 2"), FALSE);
/* Draw the line chart */
$myPicture->drawLineChart();
$myPicture->drawPlotChart(array("PlotBorder" => TRUE, "PlotSize" => 2, "BorderSize" => 3, "Surrounding" => 60, "BorderAlpha" => 50));
/* Write the chart legend */
$myPicture->drawLegend(640, 20, array("Style" => LEGEND_NOBORDER, "Mode" => LEGEND_HORIZONTAL));
/* Render the picture (choose the best way) */
$myPicture->autoOutput("pictures/example.drawZoneChart.png");
开发者ID:OndroNR,项目名称:bitcoin-hal10k,代码行数:31,代码来源:example.drawZoneChart.php

示例4: pData


//.........这里部分代码省略.........
         // Make scales based on 5% of the range of values
         $scaleMax = round($range * 0.05 + $scaleMax);
         if ($scaleMin < 0) {
             $scaleMin = $scaleMin - round($range * 0.05);
         }
         $AxisBoundaries = array(0 => array("Min" => $scaleMin, "Max" => $scaleMax));
         $scaleSettings["Mode"] = SCALE_MODE_MANUAL;
         $scaleSettings["ManualScale"] = $AxisBoundaries;
     } else {
         if ($barexists) {
             $scaleMin = "Unknown";
             $scaleMax = 0;
             foreach ($this->plot as $k => $v) {
                 if ($v["type"] == "BAR" || $v["type"] == "STACKEDBAR") {
                     $series = $v["name"] . $k;
                     $min = $graphData->getMin($series);
                     if ($scaleMin == "Unknown" || $min < $scaleMin) {
                         $scaleMin = $min;
                     }
                     $max = $graphData->getMax($series);
                     if ($scaleMax == "Unknown" || $max > $scaleMax) {
                         $scaleMax = $max;
                     }
                 }
             }
             if ($scaleMin > 0) {
                 $scaleMin = 0;
             }
             $range = $scaleMax - $scaleMin;
             // Make scales based on 5% of the range of values
             $scaleMax = round($range * 0.05 + $scaleMax);
             if ($scaleMin < 0) {
                 $scaleMin = $scaleMin - round($range * 0.05);
             }
             $AxisBoundaries = array(0 => array("Min" => $scaleMin, "Max" => $scaleMax));
             $scaleSettings["Mode"] = SCALE_MODE_MANUAL;
             $scaleSettings["ManualScale"] = $AxisBoundaries;
         }
     }
     $graphImage->drawScale($scaleSettings);
     // If there's a Pie chart we want to draw different legends
     $piechart = false;
     foreach ($this->plot as $k => $v) {
         foreach ($this->plot as $k1 => $v1) {
             $series = $v1["name"] . $k1;
             $graphData->setSerieDrawable($series, FALSE);
         }
         $series = $v["name"] . $k;
         $graphData->setSerieDrawable($series, TRUE);
         switch ($v["type"]) {
             case "PIE":
                 $piechart = true;
                 $pie = new pPie($graphImage, $graphData);
                 //$pie->draw2DPie($width_actual / 2,$height_actual / 2,80,array("DrawLabels"=>TRUE,"LabelStacked"=>TRUE,"Border"=>TRUE));
                 $pie->draw2DPie($width_actual / 2, $height_actual / 2, 80, array("WriteValues" => PIE_VALUE_PERCENTAGE, "DataGapAngle" => 10, "DataGapRadius" => 6, "Border" => TRUE, "BorderR" => 255, "BorderG" => 255, "BorderB" => 255));
                 break;
             case "PIE3D":
                 $piechart = true;
                 $pie = new pPie($graphImage, $graphData);
                 $pie->draw3DPie($this->width_actual / 2, $this->height_actual / 2, 80, array("SecondPass" => FALSE));
                 break;
             case "STACKEDBAR":
             case "BAR":
                 if ($stackeddrawn) {
                     break;
                 }
                 if ($barexists) {
                     foreach ($this->plot as $k1 => $v1) {
                         if ($v1["type"] == "BAR" || $v1["type"] == "STACKEDBAR") {
                             $graphData->setSerieDrawable($v1["name"] . $k1, TRUE);
                         }
                     }
                 }
                 $stackeddrawn = true;
                 $settings = array("Surrounding" => -30, "InnerSurrounding" => 30);
                 if ($stackedexists) {
                     $graphImage->drawStackedBarChart($settings);
                 } else {
                     $graphImage->drawBarChart($settings);
                 }
                 break;
             case "LINE":
             default:
                 if (count($v["data"]) == 1) {
                     $v["data"][] = 0;
                 }
                 $graphImage->drawLineChart($settings);
                 break;
         }
     }
     $graphData->drawAll();
     if ($piechart) {
         $pie->drawPieLegend($this->width_actual - 100, 30, array("Style" => LEGEND_NOBORDER, "Mode" => LEGEND_VERTICAL));
     } else {
         $graphImage->drawLegend($this->width_actual - 180, 22, array("Style" => LEGEND_NOBORDER, "Mode" => LEGEND_VERTICAL));
     }
     $graphImage->setShadow(TRUE, array("X" => 0, "Y" => 0, "R" => 0, "G" => 0, "B" => 0, "Alpha" => 10));
     $graphImage->render($outputfile);
     return true;
 }
开发者ID:lihaobin0320,项目名称:yii2-reportico,代码行数:101,代码来源:swgraph_pchart3.php

示例5: round

 $myPicture->setGraphArea(28 + $font * 3, 11 + $font_t * 3, $width - 15 - $width_offset, $height - 23 - $font * 3);
 #$myPicture->setGraphArea(28+$font*3,3+$font_t*3,$width-15-$width_offset,$height-23-$font*3);
 /* Draw the scale */
 $scaleMode = ($chartType == 'bar2' or $chartType == 'area2') ? SCALE_MODE_ADDALL_START0 : SCALE_MODE_START0;
 if ($labelSkip == -1) {
     $labelSkip = round($myData->getSerieCount($abscissa) / (($width - 15 - $width_offset) / 30));
 }
 $scaleSettings = $scaleRGB + array("FLOATING" => TRUE, "DrawSubTicks" => TRUE, "Mode" => $scaleMode, "CycleBackground" => TRUE, "LabelRotation" => 30, "LabelSkip" => $labelSkip);
 if ($chartRotation == 1) {
     $scaleSettings = array("Pos" => SCALE_POS_TOPBOTTOM, "LabelRotation" => 0) + $scaleSettings;
 }
 $myPicture->drawScale($scaleSettings);
 // 隐藏副坐标轴数据
 if (isset($arrSeriesY2)) {
     foreach ($arrSeriesY2 as $serie) {
         $myData->setSerieDrawable($serie, FALSE);
     }
 }
 $arrDisplayValues = array("DisplayValues" => FALSE);
 if ($plot == 2) {
     $arrDisplayValues["DisplayValues"] = TRUE;
 }
 /* Enable shadow computing */
 $myPicture->setShadow(TRUE, array("X" => 1, "Y" => 1, "R" => 0, "G" => 0, "B" => 0, "Alpha" => 10));
 /* Draw the stacked area chart */
 if ($chartType == 'area2') {
     $myPicture->drawStackedAreaChart();
 } else {
     if ($chartType == 'bar') {
         $myPicture->drawBarChart(array("Surrounding" => -15, "InnerSurrounding" => 15) + $arrDisplayValues);
     } else {
开发者ID:Strongc,项目名称:php_chart,代码行数:31,代码来源:chart_png_sxm.php

示例6: array

$myPicture->drawFilledRectangle(0, 0, 700, 230, $Settings);
/* Overlay with a gradient */
$Settings = array("StartR" => 219, "StartG" => 231, "StartB" => 139, "EndR" => 1, "EndG" => 138, "EndB" => 68, "Alpha" => 50);
$myPicture->drawGradientArea(0, 0, 700, 230, DIRECTION_VERTICAL, $Settings);
/* Add a border to the picture */
$myPicture->drawRectangle(0, 0, 699, 229, array("R" => 0, "G" => 0, "B" => 0));
/* Write the chart title */
$myPicture->setFontProperties(array("FontName" => "../fonts/Forgotte.ttf", "FontSize" => 11));
$myPicture->drawText(150, 35, "Average temperature", array("FontSize" => 20, "Align" => TEXT_ALIGN_BOTTOMMIDDLE));
/* Set the default font */
$myPicture->setFontProperties(array("FontName" => "../fonts/pf_arma_five.ttf", "FontSize" => 6));
/* Define the chart area */
$myPicture->setGraphArea(60, 40, 650, 200);
/* Draw the scale */
$scaleSettings = array("XMargin" => 10, "YMargin" => 10, "Floating" => TRUE, "GridR" => 255, "GridG" => 255, "GridB" => 255, "DrawSubTicks" => TRUE, "CycleBackground" => TRUE);
$myPicture->drawScale($scaleSettings);
/* Write the chart legend */
$myPicture->drawLegend(540, 20, array("Style" => LEGEND_NOBORDER, "Mode" => LEGEND_HORIZONTAL));
/* Turn on Antialiasing */
$myPicture->Antialias = TRUE;
/* Draw the area chart */
$MyData->setSerieDrawable("Probe 1", TRUE);
$MyData->setSerieDrawable("Probe 2", FALSE);
$myPicture->drawAreaChart();
/* Draw a line and a plot chart on top */
$MyData->setSerieDrawable("Probe 2", TRUE);
$myPicture->setShadow(TRUE, array("X" => 1, "Y" => 1, "R" => 0, "G" => 0, "B" => 0, "Alpha" => 10));
$myPicture->drawLineChart();
$myPicture->drawPlotChart(array("PlotBorder" => TRUE, "PlotSize" => 3, "BorderSize" => 1, "Surrounding" => -60, "BorderAlpha" => 80));
/* Render the picture (choose the best way) */
$myPicture->autoOutput("pictures/example.Combo.area.lines.png");
开发者ID:OndroNR,项目名称:bitcoin-hal10k,代码行数:31,代码来源:example.Combo.area.lines.php

示例7: array

$myPicture->drawGradientArea(0, 0, 700, 230, DIRECTION_VERTICAL, $Settings);
$myPicture->drawGradientArea(0, 0, 700, 20, DIRECTION_VERTICAL, array("StartR" => 0, "StartG" => 0, "StartB" => 0, "EndR" => 50, "EndG" => 50, "EndB" => 50, "Alpha" => 100));
/* Add a border to the picture */
$myPicture->drawRectangle(0, 0, 699, 229, array("R" => 0, "G" => 0, "B" => 0));
/* Write the picture title */
$myPicture->setFontProperties(array("FontName" => "../fonts/Silkscreen.ttf", "FontSize" => 6));
$myPicture->drawText(10, 13, "Chart title", array("R" => 255, "G" => 255, "B" => 255));
/* Draw the scale */
$myPicture->setFontProperties(array("FontName" => "../fonts/pf_arma_five.ttf", "FontSize" => 6));
$myPicture->setGraphArea(50, 60, 670, 190);
$myPicture->drawFilledRectangle(50, 60, 670, 190, array("R" => 255, "G" => 255, "B" => 255, "Surrounding" => -200, "Alpha" => 10));
$myPicture->drawScale(array("CycleBackground" => TRUE));
/* Graph title */
$myPicture->setFontProperties(array("FontName" => "../fonts/Forgotte.ttf", "FontSize" => 11));
$myPicture->setShadow(TRUE, array("X" => 1, "Y" => 1, "R" => 0, "G" => 0, "B" => 0, "Alpha" => 10));
$myPicture->drawText(50, 52, "Chart subtitle", array("FontSize" => 20, "Align" => TEXT_ALIGN_BOTTOMLEFT));
/* Draw the bar chart chart */
$myPicture->setFontProperties(array("FontName" => "../fonts/pf_arma_five.ttf", "FontSize" => 6));
$MyData->setSerieDrawable("Last year", FALSE);
$myPicture->drawBarChart();
/* Draw the line and plot chart */
$MyData->setSerieDrawable("Last year", TRUE);
$MyData->setSerieDrawable("This year", FALSE);
$myPicture->drawSplineChart();
$myPicture->drawPlotChart();
/* Make sure all series are drawable before writing the scale */
$MyData->drawAll();
/* Write the legend */
$myPicture->drawLegend(580, 35, array("Style" => LEGEND_ROUND, "Alpha" => 20, "Mode" => LEGEND_HORIZONTAL));
/* Render the picture (choose the best way) */
$myPicture->autoOutput("pictures/example.combo.png");
开发者ID:Esleelkartea,项目名称:herramienta_para_autodiagnostico_ADEADA,代码行数:31,代码来源:example.Combo.php

示例8: array

    //rgb(69,43,135)
    /* Draw the scale */
    $myPicture->setFontProperties(array("FontName" => "../pChart/fonts/verdana.ttf", "FontSize" => 8));
    $myPicture->setGraphArea(50, 60, 670, 340);
    $myPicture->drawFilledRectangle(50, 60, 670, 340, array("R" => 255, "G" => 255, "B" => 255, "Surrounding" => -200, "Alpha" => 10));
    $axisBoundaries = array(0 => array("Min" => 0, "Max" => $yaxis - 1));
    $scaleSettings = array("GridR" => 200, "GridG" => 200, "GridB" => 200, "DrawXLines" => FALSE, "MinDivHeight" => 50, "DrawSubTicks" => FALSE, "CycleBackground" => TRUE, "Mode" => SCALE_MODE_MANUAL, "ManualScale" => $axisBoundaries);
    $myPicture->drawScale($scaleSettings);
    /* Graph title */
    //$myPicture->setFontProperties(array("FontName"=>"../pChart/fonts/Forgotte.ttf","FontSize"=>11));
    //$myPicture->setShadow(TRUE,array("X"=>1,"Y"=>1,"R"=>0,"G"=>0,"B"=>0,"Alpha"=>10));
    //$myPicture->drawText(50,52,"Chart subtitle",array("FontSize"=>20,"Align"=>TEXT_ALIGN_BOTTOMLEFT));
    $Palette = array("0" => array("R" => 32, "G" => 74, "B" => 140, "Alpha" => 100), "1" => array("R" => 32, "G" => 74, "B" => 140, "Alpha" => 100), "2" => array("R" => 69, "G" => 43, "B" => 135, "Alpha" => 100), "3" => array("R" => 69, "G" => 43, "B" => 135, "Alpha" => 100));
    /* Draw the bar chart chart */
    $myPicture->setFontProperties(array("FontName" => "../pChart/fonts/verdana.ttf", "FontSize" => 10));
    $data->setSerieDrawable("Last year", FALSE);
    $myPicture->drawBarChart(array("DisplayPos" => LABEL_POS_INSIDE, "DisplayValues" => TRUE, "DisplayOrientation" => ORIENTATION_HORIZONTAL, "Surrounding" => 30, "OverrideColors" => $Palette, "DisplayColor" => DISPLAY_MANUAL, "DisplayR" => 255, "DisplayG" => 255, "DisplayB" => 255));
    $myPicture->drawThresholdArea($result->Benchmark_Low, $result->Benchmark_High, array("R" => 177, "G" => 221, "B" => 207, "Alpha" => 40));
    /* Make sure all series are drawable before writing the scale */
    $data->drawAll();
    /* Write the legend */
    //$myPicture->setShadow(TRUE,array("X"=>1,"Y"=>1,"R"=>0,"G"=>0,"B"=>0,"Alpha"=>10));
    //$myPicture->drawLegend(580,35,array("Style"=>LEGEND_ROUND,"Alpha"=>20,"Mode"=>LEGEND_HORIZONTAL));
    /* Render the picture (choose the best way) */
    //$myPicture->autoOutput("pictures/example.combo.png");
    $myPicture->Stroke();
} else {
    $entries = $tc->getEntries();
    $metrics = $tc->getScored();
    $option_values = '';
    foreach ($entries as $entry) {
开发者ID:redsummit,项目名称:anitaborg,代码行数:31,代码来源:charts.php

示例9: pData

<?php

/* CAT:Scaling */
/* pChart library inclusions */
include "../class/pData.class.php";
include "../class/pDraw.class.php";
include "../class/pImage.class.php";
/* Create and populate the pData object */
$MyData = new pData();
$MyData->addPoints(array(8, 10, 24, 25, 25, 24, 23, 22, 20, 12, 10, 4), "Temperature");
$MyData->addPoints(array(2, 4, 6, 4, 5, 3, 6, 4, 5, 8, 6, 1), "Pressure");
$MyData->setSerieDrawable("Pressure", FALSE);
$MyData->setAxisName(0, "Temperatures");
$MyData->addPoints(array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"), "Labels");
$MyData->setSerieDescription("Labels", "Months");
$MyData->setAbscissa("Labels");
/* Create the pChart object */
$myPicture = new pImage(700, 390, $MyData);
/* Draw the background */
$Settings = array("R" => 170, "G" => 183, "B" => 87, "Dash" => 1, "DashR" => 190, "DashG" => 203, "DashB" => 107);
$myPicture->drawFilledRectangle(0, 0, 700, 390, $Settings);
/* Overlay with a gradient */
$Settings = array("StartR" => 219, "StartG" => 231, "StartB" => 139, "EndR" => 1, "EndG" => 138, "EndB" => 68, "Alpha" => 50);
$myPicture->drawGradientArea(0, 0, 700, 390, DIRECTION_VERTICAL, $Settings);
$myPicture->drawGradientArea(0, 0, 700, 20, DIRECTION_VERTICAL, array("StartR" => 0, "StartG" => 0, "StartB" => 0, "EndR" => 50, "EndG" => 50, "EndB" => 50, "Alpha" => 80));
/* Add a border to the picture */
$myPicture->drawRectangle(0, 0, 699, 389, array("R" => 0, "G" => 0, "B" => 0));
/* Write the picture title */
$myPicture->setFontProperties(array("FontName" => "../fonts/Silkscreen.ttf", "FontSize" => 6));
$myPicture->drawText(10, 13, "drawScale() - draw the X-Y scales", array("R" => 255, "G" => 255, "B" => 255));
/* Write the chart title */
开发者ID:josepabloapu,项目名称:statistical-analysis-tools-lamp,代码行数:31,代码来源:example.drawScale.labels.php

示例10: pData

include "pChart/class/pData.class.php";
include "pChart/class/pDraw.class.php";
include "pChart/class/pImage.class.php";
include "statistics_description_text.php";
$width = 760;
$height = 500;
$pChart = new pData();
$chart_tile_colours = array("0" => array("R" => 246, "G" => 113, "B" => 53, "Alpha" => 100), "1" => array("R" => 211, "G" => 60, "B" => 29, "Alpha" => 100), "2" => array("R" => 80, "G" => 94, "B" => 97, "Alpha" => 100), "3" => array("R" => 131, "G" => 137, "B" => 129, "Alpha" => 100), "4" => array("R" => 42, "G" => 43, "B" => 45, "Alpha" => 100), "5" => array("R" => 116, "G" => 82, "B" => 73, "Alpha" => 100), "6" => array("R" => 190, "G" => 93, "B" => 72, "Alpha" => 100), "7" => array("R" => 95, "G" => 83, "B" => 84, "Alpha" => 100), "8" => array("R" => 220, "G" => 220, "B" => 220, "Alpha" => 100));
for ($i = 0; $i < count($colours); $i++) {
    $pChart->addPoints(array($tile_colour_results[0][$i], $tile_colour_results[1][$i], $tile_colour_results[2][$i], $tile_colour_results[3][$i], $tile_colour_results[4][$i], $tile_colour_results[5][$i], $tile_colour_results[6][$i], $tile_colour_results[7][$i], $tile_colour_results[8][$i], $tile_colour_results[9][$i], $tile_colour_results[10][$i], $tile_colour_results[11][$i], $tile_colour_results[12][$i]), "Serie{$i}");
    $pChart->setSerieDescription("Serie{$i}", $colours[$i][0]);
    $pChart->setSerieOnAxis("Serie{$i}", 0);
    $pChart->setPalette("Serie{$i}", $chart_tile_colours[$i]);
}
$pChart->addPoints(array(get_tile_total_count($tile_colour_results, 0), get_tile_total_count($tile_colour_results, 1), get_tile_total_count($tile_colour_results, 2), get_tile_total_count($tile_colour_results, 3), get_tile_total_count($tile_colour_results, 4), get_tile_total_count($tile_colour_results, 5), get_tile_total_count($tile_colour_results, 6), get_tile_total_count($tile_colour_results, 7), get_tile_total_count($tile_colour_results, 8), get_tile_total_count($tile_colour_results, 9), get_tile_total_count($tile_colour_results, 10), get_tile_total_count($tile_colour_results, 11), get_tile_total_count($tile_colour_results, 12)), "Serie10");
$pChart->setSerieDrawable("Serie10", FALSE);
$pChart->setPalette("Serie10", array("Alpha" => 0));
$pChart->addPoints(array("Ormax", "Protector", "Polar", "Minster", "Turmalin", "Granat", "E13", "T11", "Nova", "Rubin", "Nortegl", "Hollander", "KDN"), "Absissa");
$pChart->setAbscissa("Absissa");
$pChart->setAxisPosition(0, AXIS_POSITION_LEFT);
$pChart->setAxisName(0, "Laskentamäärät kpl");
$pChart->setAxisUnit(0, "");
$pChartPicture = new pImage($width, $height, $pChart);
$Settings = array("R" => 255, "G" => 255, "B" => 255);
$pChartPicture->drawFilledRectangle(0, 0, $width, $height, $Settings);
$pChartPicture->setFontProperties(array("FontName" => "pChart/fonts/arial.ttf", "FontSize" => 14));
$TextSettings = array("Align" => TEXT_ALIGN_BOTTOMMIDDLE, "R" => 0, "G" => 0, "B" => 0);
$pChartPicture->drawText($width / 2, 25, ucfirst($table) . " - Tiilet / Värit", $TextSettings);
$description .= GetYearsDescription($years);
$description .= " - (" . GetSeriesTotalSum($pChart, "Half") . "kpl)";
if (strlen($description) > 120) {
开发者ID:hyttjo,项目名称:ormaxlaskenta,代码行数:31,代码来源:statistics_tile_and_colour_chart.php

示例11: array

     /* Add a border to the picture */
     $myPicture->drawRectangle(0, 0, 65 * $nbr_room + 64, 329, array("R" => 0, "G" => 0, "B" => 0));
     /* Write the chart title */
     $myPicture->setFontProperties(array("FontName" => "pChart/fonts/Silkscreen.ttf", "FontSize" => 6, "R" => 255, "G" => 255, "B" => 255));
     $myPicture->drawText(10, 13, "Consomation moyenne des baies avec objectif a 3,5 kW", array("R" => 255, "G" => 255, "B" => 255));
     /* Define the default font */
     $myPicture->setFontProperties(array("FontName" => "pChart/fonts/verdana.ttf", "FontSize" => 10));
     $myPicture->setShadow(TRUE, array("X" => 1, "Y" => 1, "R" => 0, "G" => 0, "B" => 0, "Alpha" => 20));
     /* Set the graph area */
     $myPicture->setGraphArea(50, 40, 65 * $nbr_room + 35, 290);
     $myPicture->drawGradientArea(50, 40, 65 * $nbr_room + 35, 290, DIRECTION_VERTICAL, array("StartR" => 200, "StartG" => 200, "StartB" => 200, "EndR" => 255, "EndG" => 255, "EndB" => 255, "Alpha" => 30));
     /* Draw the chart scale */
     $scaleSettings = array("AxisAlpha" => 10, "TickAlpha" => 10, "DrawXLines" => FALSE, "Mode" => SCALE_MODE_START0, "GridR" => 0, "GridG" => 0, "GridB" => 0, "GridAlpha" => 10);
     $myPicture->drawScale($scaleSettings);
     /* Draw the chart */
     $MyData->setSerieDrawable("Objectif", FALSE);
     $myPicture->drawBarChart(array("DisplayValues" => TRUE, "DisplayPos" => LABEL_POS_INSIDE, "Surrounding" => 30));
     $MyData->setSerieDrawable("Objectif", TRUE);
     $MyData->setSerieDrawable("Consomation moyenne des baies (kW)", FALSE);
     $MyData->setSerieDrawable("Salles", FALSE);
     $serieSettings = array("R" => 229, "G" => 11, "B" => 11);
     $MyData->setPalette("Objectif", $serieSettings);
     $myPicture->setShadow(TRUE, array("X" => 2, "Y" => 2, "R" => 0, "G" => 0, "B" => 0, "Alpha" => 10));
     $myPicture->drawSplineChart();
     if ($consult_date != "Donnée actuelle") {
         $myPicture->Render("images/consoe_graph_render_{$consult_date}.png");
     } else {
         $myPicture->Render("images/consoe_graph_render.png");
     }
 } else {
     $error = 1;
开发者ID:Ankyrine,项目名称:Stage-4A,代码行数:31,代码来源:consoe_graph_render.php

示例12: round

        $scaleMax = round($range * 0.05 + $scaleMax);
        if ($scaleMin < 0) {
            $scaleMin = $scaleMin - round($range * 0.05);
        }
        $AxisBoundaries = array(0 => array("Min" => $scaleMin, "Max" => $scaleMax));
        $scaleSettings["Mode"] = SCALE_MODE_MANUAL;
        $scaleSettings["ManualScale"] = $AxisBoundaries;
    }
}
$graphImage->drawScale($scaleSettings);
// If there's a Pie chart we want to draw different legends
$piechart = false;
foreach ($plot as $k => $v) {
    foreach ($plot as $k1 => $v1) {
        $series = $v1["name"] . $k1;
        $graphData->setSerieDrawable($series, FALSE);
    }
    $series = $v["name"] . $k;
    $graphData->setSerieDrawable($series, TRUE);
    switch ($v["type"]) {
        case "PIE":
            $piechart = true;
            $pie = new pPie($graphImage, $graphData);
            //$pie->draw2DPie($width / 2,$height / 2,80,array("DrawLabels"=>TRUE,"LabelStacked"=>TRUE,"Border"=>TRUE));
            $pie->draw2DPie($width / 2, $height / 2, 80, array("WriteValues" => PIE_VALUE_PERCENTAGE, "DataGapAngle" => 10, "DataGapRadius" => 6, "Border" => TRUE, "BorderR" => 255, "BorderG" => 255, "BorderB" => 255));
            break;
        case "PIE3D":
            $piechart = true;
            $pie = new pPie($graphImage, $graphData);
            $pie->draw3DPie($width / 2, $height / 2, 80, array("SecondPass" => FALSE));
            break;
开发者ID:LionSystemsSolutions,项目名称:El-Canelo-ERP,代码行数:31,代码来源:dyngraph_pchart3.php

示例13: makeChartArticle

 static function makeChartArticle($type, $data, $events, $colors, $lang = "en")
 {
     global $wt, $I18N;
     $font = PCHART_FONTS_PATH . "/LiberationSans-Regular.ttf";
     if (in_array($wt->uselang, array("zh", "ja", "jp", "ko"))) {
         $font = PCHART_FONTS_PATH . "/wqy-microhei.ttf";
     }
     if (in_array($wt->uselang, array("he", "bn", "vi", "fa", "ar", "th", "ta", "ka", "hi", "hy", "ml"))) {
         $font = PCHART_FONTS_PATH . "/unifont.ttf";
     }
     $maxsizeTotal = 0;
     $maxeditTotal = 0;
     $u = 0;
     foreach ($data as $year => $values) {
         $years[] = $year;
         $all[] = $values["all"];
         $minor[] = $values["minor"];
         $anon[] = $values["anon"];
         $maxsize = 0;
         //get the max size of each month
         foreach ($values["months"] as $i => $mdetails) {
             if ($mdetails["size"] > $maxsize) {
                 $maxsize = $mdetails["size"];
             }
         }
         $tmpssize[] = $maxsize ? $maxsize : $tmpssize[$u - 1];
         $linemarker[] = 1;
         $eventmarker[] = isset($events[$year]["protect"]) ? 10 + $events[$year]["protect"] * 3 : 0;
         $u++;
     }
     $msgAll = $I18N->msg('all');
     $msgMinor = $I18N->msg('minor');
     $msgPagesize = $I18N->msg('pagesize');
     $MyData = new pData();
     $MyData->addPoints($all, "all");
     $MyData->addPoints($minor, "minor");
     $MyData->addPoints($anon, "anon");
     $MyData->addPoints($tmpssize, "size");
     $MyData->addPoints($eventmarker, "protect");
     $MyData->setSerieOnAxis("all", 0);
     $MyData->setSerieOnAxis("minor", 0);
     $MyData->setSerieOnAxis("anon", 0);
     $MyData->setSerieOnAxis("size", 1);
     $MyData->setSerieOnAxis("protect", 1);
     $MyData->setAxisPosition(1, AXIS_POSITION_RIGHT);
     $MyData->setAxisName(0, "Edits");
     $MyData->setAxisName(1, "Size (kb)");
     $MyData->Data["Series"]["all"]["Color"] = self::hex2rgb($colors["all"], 200, true);
     $MyData->Data["Series"]["minor"]["Color"] = self::hex2rgb($colors["minor"], 200, true);
     $MyData->Data["Series"]["anon"]["Color"] = self::hex2rgb($colors["anon"], 200, true);
     $MyData->Data["Series"]["size"]["Color"] = self::hex2rgb($colors["size"], 200, true);
     $MyData->Data["Series"]["protect"]["Color"] = self::hex2rgb($colors["protect"], 200, true);
     $MyData->addPoints($years, "Labels");
     $MyData->setAbscissa("Labels");
     $myPicture = new pImage(1000, 300, $MyData, TRUE);
     $myPicture->setFontProperties(array("FontName" => $font, "FontSize" => 12, "R" => 34, "G" => 34, "B" => 34));
     $myPicture->setGraphArea(50, 30, 820, 270);
     $myPicture->setFontProperties(array("FontName" => $font, "FontSize" => 8));
     $scaleSettings = array("AxisR" => 134, "AxisG" => 134, "AxisB" => 134, "AxisAplha" => 40, "DrawSubTicks" => TRUE, "CycleBackground" => false, "LabelRotation" => 0, "LabelSkip" => 0, "Mode" => SCALE_MODE_START0);
     $myPicture->drawScale($scaleSettings);
     $settings = array("Surrounding" => -30, "InnerSurrounding" => 10, "RecordImageMap" => false, "DisplayValues" => false);
     $MyData->setSerieDrawable('size', false);
     $MyData->setSerieDrawable('protect', false);
     $myPicture->drawBarChart($settings);
     $MyData->setSerieDrawable('size', true);
     $MyData->setSerieDrawable('all', false);
     $MyData->setSerieDrawable('minor', false);
     $MyData->setSerieDrawable('anon', false);
     $MyData->setSerieDrawable('protect', false);
     $myPicture->drawLineChart();
     $MyData->setSerieDrawable('protect', true);
     $MyData->setSerieDrawable('size', true);
     $myBubbleChart = new pBubble($myPicture, $MyData);
     $bubbleDataSeries = array("size");
     $bubbleWeightSeries = array("protect");
     $myBubbleChart->bubbleScale($bubbleDataSeries, $bubbleWeightSeries);
     $myBubbleChart->drawBubbleChart($bubbleDataSeries, $bubbleWeightSeries, array("ForceAlpha" => true));
     $myPicture->setFontProperties(array("FontName" => $font, "FontSize" => 11, "R" => 34, "G" => 34, "B" => 34));
     $MyData->setSerieDrawable('size', true);
     $MyData->setSerieDrawable('all', true);
     $MyData->setSerieDrawable('minor', true);
     $MyData->setSerieDrawable('anon', true);
     $MyData->setSerieDrawable('protect', true);
     $myPicture->drawLegend(900, 55, array("Style" => LEGEND_NOBORDER, "BoxWidth" => 10, "BoxHeight" => 10, "Mode" => LEGEND_VERTICAL));
     ob_start();
     imagepng($myPicture->Picture);
     $imgdata = ob_get_contents();
     ob_end_clean();
     $rimg = "data:image/png;base64," . base64_encode($imgdata);
     return $rimg;
 }
开发者ID:Krinkle,项目名称:xtools,代码行数:91,代码来源:Graph.php

示例14: pImage

$MyData->addPoints($data["times"], "Labels");
$MyData->setSerieDescription("Labels", "Months");
$MyData->setAbscissa("Labels");
$myPicture = new pImage(1400, 460, $MyData);
$myPicture->Antialias = FALSE;
$myPicture->setFontProperties(array("FontName" => "pChart/fonts/Forgotte.ttf", "FontSize" => 8, "R" => 0, "G" => 0, "B" => 0));
$myPicture->drawText(15, 22, "HAL10K by intrd", array("FontSize" => 15, "Align" => TEXT_ALIGN_BOTTOMLEFT));
//$myPicture->drawText(15,22,"HAL10K by intrd",array("FontSize"=>15,"Align"=>TEXT_ALIGN_BOTTOMLEFT));
$myPicture->drawText(450, 20, "Período: " . $startdate . " - " . $enddate . "", array("FontSize" => 13, "Align" => TEXT_ALIGN_BOTTOMLEFT));
$myPicture->drawText(651, 23, $nextmov, array("FontSize" => 13, "Align" => TEXT_ALIGN_BOTTOMLEFT));
$myPicture->setFontProperties(array("FontName" => "pChart/fonts/pf_arma_five.ttf", "FontSize" => 10, "R" => 0, "G" => 0, "B" => 0));
$myPicture->setGraphArea(20 * 2, 20, 650 * 2, 200 * 2);
$scaleSettings = array("XMargin" => 10, "YMargin" => 10, "Floating" => TRUE, "GridR" => 200, "GridG" => 200, "GridB" => 500, "DrawSubTicks" => TRUE, "CycleBackground" => TRUE);
$myPicture->drawScale($scaleSettings);
$myPicture->Antialias = TRUE;
$MyData->setSerieDrawable("BTC/USD", TRUE);
$MyData->setSerieDrawable("EMAshort", TRUE);
$MyData->setSerieDrawable("EMAlong", TRUE);
$MyData->setSerieDrawable("Buy", FALSE);
$MyData->setSerieDrawable("Sell", FALSE);
$myPicture->drawLineChart(array("DisplayValues" => FALSE));
$MyData->setSerieDrawable("BTC/USD", FALSE);
$MyData->setSerieDrawable("EMAshort", FALSE);
$MyData->setSerieDrawable("EMAlong", FALSE);
$MyData->setSerieDrawable("Buy", TRUE);
$MyData->setSerieDrawable("Sell", TRUE);
$myPicture->drawPlotChart(array("DisplayValues" => TRUE, "PlotBorder" => FALSE, "BorderSize" => 2, "Surrounding" => -60, "BorderAlpha" => 80));
$MyData->setSerieDrawable("BTC/USD", TRUE);
$MyData->setSerieDrawable("EMAshort", TRUE);
$MyData->setSerieDrawable("EMAlong", TRUE);
$MyData->setSerieDrawable("Buy", TRUE);
开发者ID:OndroNR,项目名称:bitcoin-hal10k,代码行数:31,代码来源:chart.php


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